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
2023-12-27 20:38:45
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
下一篇:iOS组件化开发-发布私有库