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

adjust: in China, phone number increase very quickly. #523

Merged
merged 1 commit into from
Apr 9, 2016
Merged

adjust: in China, phone number increase very quickly. #523

merged 1 commit into from
Apr 9, 2016

Conversation

sunfuze
Copy link
Contributor

@sunfuze sunfuze commented Apr 9, 2016

I used this lib to validate in express, but i found 1708****484 cant be recognize as phone('zh_CN'), i checked the source code, found the limit, the regEx is:

/^(\+?0?86\-?)?((13\d|14[57]|15[^4,\D]|17[678]|18\d)\d{8}|170[059]\d{7})$/

One thing that China so different is so many consumers, so phone number increase very quickly. 170[059] is not engouh. The best way is no limit in tail 8 numbers, like old code done.The old is:

/^(\+?0?86\-?)?1[345789]\d{9}$/

@coveralls
Copy link

Coverage Status

Coverage remained the same at 99.087% when pulling c1fcbb6 on sunfuze:adjust/phone-zh_CN into 449bbbf on chriso:master.

@chriso
Copy link
Collaborator

chriso commented Apr 9, 2016

Thanks.

@chriso chriso merged commit ae14b7d into validatorjs:master Apr 9, 2016
chriso added a commit that referenced this pull request Apr 9, 2016
@sunfuze sunfuze deleted the adjust/phone-zh_CN branch April 11, 2016 13:37
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

Successfully merging this pull request may close these issues.

3 participants