Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

145/147开头的中国手机号码支持 #32

Closed
yinjs opened this issue Jan 7, 2021 · 10 comments
Closed

145/147开头的中国手机号码支持 #32

yinjs opened this issue Jan 7, 2021 · 10 comments

Comments

@yinjs
Copy link

yinjs commented Jan 7, 2021

麻烦更新一下14开头的手机号的支持,以下信息未验证,仅供参考
https://zhidao.baidu.com/question/553946707.html

@yinjs
Copy link
Author

yinjs commented Jan 7, 2021

提了一个PR: #33

@VincentSit
Copy link
Owner

具体是哪个号段没有支持呢?你提的这两个号段已经是支持了。

@yinjs
Copy link
Author

yinjs commented Jan 7, 2021

具体是哪个号段没有支持呢?你提的这两个号段已经是支持了。

145(联通)和147(移动) ,原先好像不支持的,你看一下PR上的改动

@yinjs yinjs changed the title 14开头的手机号码支持 145/147开头的中国手机号码支持 Jan 7, 2021
@VincentSit
Copy link
Owner

支持的。高频使用的在左侧,14 之类的在尾部。
image

@yinjs
Copy link
Author

yinjs commented Jan 7, 2021

例如这个正则 手机卡 - 匹配所有 这个正则返回false
/^(?:\+?86)?1(?:3\d{3}|5[^4\D]\d{2}|8\d{3}|7(?:[235-8]\d{2}|4(?:0\d|1[0-2]|9\d))|9[0-35-9]\d{2}|66\d{2})\d{6}$/.test('14512345678')

@yinjs
Copy link
Author

yinjs commented Jan 7, 2021

支持的。高频使用的在左侧,14 之类的在尾部。
image

增加145/147之后的正则可以返回true
/^(?:\+?86)?1(?:3\d{3}|4[57]\d{2}|5[^4\D]\d{2}|8\d{3}|7(?:[235-8]\d{2}|4(?:0\d|1[0-2]|9\d))|9[0-35-9]\d{2}|66\d{2})\d{6}$/.test('14512345678')

@yinjs
Copy link
Author

yinjs commented Jan 7, 2021

懂了,是在后面,但是好像不能识别

@VincentSit
Copy link
Owner

你可能理解错了这个分类。这个项目里的号码卡是分为手机卡、数据卡和上网卡,你那个 145 是属于上网卡的,手机卡的正则不匹配是正常的。你可以用这个正则

@yinjs
Copy link
Author

yinjs commented Jan 7, 2021

好的,谢谢

@VincentSit
Copy link
Owner

不客气,有问题再留言。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants