Coder Social home page Coder Social logo

chinamobilephonenumberregex's Introduction

ChinaMobilePhoneNumberRegex

A set of regular expressions to match the mobile phone number in mainland China.

Regular Expressions

Match all:

^(?=\d{11}$)^1(?:3\d|4[57]|5[^4\D]|66|7[^249\D]|8\d|9[89])\d{8}$

Except MVNO phone numbers:

^(?=\d{11}$)^1(?:3\d|4[57]|5[^4\D]|66|7[^01249\D]|8\d|9[89])\d{8}$

Except satellite phone numbers:

^(?=\d{11}$)^1(?:3(?!49)\d|4[57]|5[^4\D]|66|7[^249\D]|8\d|9[89])\d{8}$

Except data-only phone numbers:

^(?=\d{11}$)^1(?:3\d|5[^4\D]|66|7[^249\D]|8\d|9[89])\d{8}$

Only China Mobile:

^(?=\d{11}$)^1(?:(?:3(?!49)[4-9\D]|47|5[012789]|78|8[23478]|98)\d{8}$|(?:70[356])\d{7}$)

Only China Unicom:

^(?=\d{11}$)^1(?:(?:3[0-2]|45|5[56]|66|7[156]|8[56])\d{8}$|(?:70[4789])\d{7}$)

Only China Telecom:

^(?=\d{11}$)^1(?:(?:33|49|53|7[37]|8[019]|99)\d{8}$|(?:349|70[0-2])\d{7}$)


Note: These regular expressions can only match the **mobile phone number** in **mainland China**.

Test/Debug Online

https://regex101.com/

Rules

Prefix Provider Network
130/1/2 China Unicom GSM
133 China Telecom[1] CDMA
1340–1348 China Mobile GSM
1349 ChinaSat Satellite
135/6/7/8/9 China Mobile GSM
145 China Unicom WCDMA[2]
147 China Mobile TD-SCDMA/GSM[3]
150/1/2/8/9 China Mobile GSM
153 China Telecom[4] CDMA
155 China Unicom GSM
156 China Unicom GSM/WCDMA[5]
157 China Mobile TD-SCDMA
166 China Unicom FDD-LTE/TD-LTE
1700/1/2 China Telecom CDMA2000
1703/5/6 China Mobile TD-SCDMA/GSM
1704/7/8/9 China Unicom WCDMA/GSM
171 China Unicom WCDMA/GSM
176 China Unicom FDD-LTE/TD-LTE
177 China Telecom FDD-LTE/TD-LTE
178 China Mobile TD-LTE
180/1 China Telecom CDMA2000
182/3/4 China Mobile GSM
185/6 China Unicom WCDMA
187/8 China Mobile TD-SCDMA
189 China Telecom CDMA2000
198 China Mobile FDD-LTE/TD-LTE
199 China Telecom FDD-LTE/TD-LTE
  1. Formerly China Unicom
  2. Data-plans only. Have the ability to send or receive text or multimedia messages. Do not have the ability to make or receive calls.
  3. Same as 2.
  4. Same as 1.
  5. Upgradeable to WCDMA.

Note: 170 and 171, are allocated to Mobile virtual network operator.

This table is quote from Telephone numbers in China in Wikipedia and made some changes to suit the actual situation.

Release Notes

2017.08.09

  • Added support for 166*/198*/199* numbers.

2016.10.15

  • Added English documentation.
  • Added support for 175* numbers.
  • Remove test project.
  • Fixed 1349* matching issues.

2016.04.05

  • Added the 171* numbers support.
  • Separated 14* numbers matching.
  • Improved the virtual operator segment matching.

2014.12.19

  • Initial release.

License

Regular expressions are MIT-licensed.

The documentation is licensed CC BY-SA 3.0.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.