Python 手机号正则匹配

# -*- coding:utf-8 -*-

import re

def is_phone(phone):
    phone_pat = re.compile('^(13\d|14[5|7]|15\d|166|17[3|6|7]|18\d)\d{8}$')
    res = re.search(phone_pat, phone)
    if not res:
        return False
    return True

 

相关文章:

  • 2022-01-09
  • 2021-08-12
  • 2021-07-30
  • 2022-12-23
  • 2021-11-29
  • 2021-12-18
  • 2021-08-19
  • 2021-12-06
猜你喜欢
  • 2022-12-23
  • 2021-10-03
  • 2021-11-23
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案