import re
phone = str(input('请输入手机号:'))
# b = str(12345678912)
t = re.compile(r'^1(3\d|4[4-9]|5[0-35-9]|6[67]|7[013-8]|8[0-9]|9[0-9])\d{8}$')
s = re.search(t,phone)
# print(s)
if s:
print(s.group(),'是正常手机号')
else:
print('手机号格式不正确')

发布时间:2019-05-20 22:54:34编辑:auto阅读(3340)
import re
phone = str(input('请输入手机号:'))
# b = str(12345678912)
t = re.compile(r'^1(3\d|4[4-9]|5[0-35-9]|6[67]|7[013-8]|8[0-9]|9[0-9])\d{8}$')
s = re.search(t,phone)
# print(s)
if s:
print(s.group(),'是正常手机号')
else:
print('手机号格式不正确')

上一篇: Python中模块
下一篇: Selenium爬取淘宝商品概要入mon
51279
50728
41328
38140
32604
29508
28361
23227
23195
21521
1593°
2316°
1924°
1865°
2192°
1906°
2596°
4356°
4208°
2988°