fix: use a loose and future-oriented way to verify Chinese mobile phone numbers by yisibl · Pull Request #1682 · validatorjs/validator.js

The current zh-CN mobile phone number verification rules are too strict. With the increasing number of mobile phone numbers in China, this regularity will become difficult to maintain.

To this end, we should follow the official document (《电信网编号计划(2017年版)》) only need to verify the first two digits. This is a word document. For the convenience of viewing, I made a screenshot.

In this table, all mobile phone numbers from 13 to 19 exist except those starting with 12, and the addition of mobile phone numbers starting with 92 and 98 will be considered in the future. For better compatibility with the future, this PR also added 92/98 support. In addition, this PR does not consider IoT numbers.

image

ps: This library maintains a more detailed operator mobile phone number: https://github.com/VincentSit/ChinaMobilePhoneNumberRegex#rules

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)