Skip to content

Commit

Permalink
Edit Chinese MobilePhone Verifying regular.
Browse files Browse the repository at this point in the history
  • Loading branch information
mlinquan committed Mar 9, 2018
1 parent e8eef94 commit 195b73f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ var phones = {
'tr-TR': /^(\+?90|0)?5\d{9}$/,
'uk-UA': /^(\+?38|8)?0\d{9}$/,
'vi-VN': /^(\+?84|0)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/,
'zh-CN': /^(\+?0?86\-?)?1[3456789]\d{9}$/,
'zh-CN': /^((\+|00)86)?1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$/,
'zh-TW': /^(\+?886\-?|0)?9\d{8}$/
};
/* eslint-enable max-len */
Expand Down
2 changes: 1 addition & 1 deletion src/lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const phones = {
'tr-TR': /^(\+?90|0)?5\d{9}$/,
'uk-UA': /^(\+?38|8)?0\d{9}$/,
'vi-VN': /^(\+?84|0)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/,
'zh-CN': /^(\+?0?86\-?)?1[3456789]\d{9}$/,
'zh-CN': /^((\+|00)86)?1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$/,
'zh-TW': /^(\+?886\-?|0)?9\d{8}$/,
};
/* eslint-enable max-len */
Expand Down
21 changes: 15 additions & 6 deletions test/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -3220,17 +3220,26 @@ describe('Validators', function () {
'15323456787',
'13523333233',
'13898728332',
'+086-13238234822',
'08613487234567',
'8617823492338',
'86-17823492338',
'+8613238234822',
'+8613487234567',
'+8617823492338',
'+8617823492338',
'16637108167',
'86-16637108167',
'+086-16637108167',
'+8616637108167',
'+8616637108167',
'008618812341234',
'008618812341234',
'+8619912341234',
'+8619812341234',
],
invalid: [
'12345',
'',
'+08613811211114',
'+008613811211114',
'08613811211114',
'0086-13811211114',
'0086-138-1121-1114',
'Vml2YW11cyBmZXJtZtesting123',
'010-38238383',
],
Expand Down
2 changes: 1 addition & 1 deletion validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ var phones = {
'tr-TR': /^(\+?90|0)?5\d{9}$/,
'uk-UA': /^(\+?38|8)?0\d{9}$/,
'vi-VN': /^(\+?84|0)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/,
'zh-CN': /^(\+?0?86\-?)?1[3456789]\d{9}$/,
'zh-CN': /^((\+|00)86)?1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$/,
'zh-TW': /^(\+?886\-?|0)?9\d{8}$/
};
/* eslint-enable max-len */
Expand Down
2 changes: 1 addition & 1 deletion validator.min.js

Large diffs are not rendered by default.

0 comments on commit 195b73f

Please sign in to comment.