Python 手机号正则匹配
# -*- coding:utf-8 -*- import re def is_phone(phone): phone_pat = re.compile('^(13d|14[5|7]|15d|166|17[3|6|7]|18d)d{8}$') res = re.search(phone_pat, phone) if not res: return False return True