Mobile phone number regular expression in Android

Source: Internet
Author: User

Mobile phone name has GSM: said only support China Unicom or mobile 2G segment (130, 131, 132, 134, 135, 136, 137, 138, 139, 145, 147, 150, 151, 152, 155, 156, 157, 158, 159, 182, 185, 186, 187, 188)

Mobile phone name CDMA: only support China Telecom 2G (133, 153, 180, 181, 189)

mobile phone name has WCDMA/GSM: support China Unicom or mobile 2G, and China Unicom 3G segment (130, 131, 132, 134, 135, 136, 137, 138, 139, 145, 147, 150, 151, 152, 155, 156, 157, 158, 159, 182,183, 185, 186, 187, 188), does not support mobile 3G business, does not support the telecom card.

The name of the mobile phone has td-scdma/gsm: support China Unicom or mobile 2G segment, and China Mobile 3G (130, 131, 132, 134, 135, 136, 137, 138, 139, 145, 147, 150, 151, 152, 155, 156, 157, 158, 159, 182,183, 185, 186, 187, 188), does not support Unicom 3G business, does not support the telecom card.

mobile phone name has CDMA2000/CDMA: support China Telecom 2G segment, and China Telecom 3G (133, 153, 180, 181, 189), does not support mobile Unicom card

mobile phone name has cdma2000/gsm (dual mode): a card to support China Telecom 2G segment, as well as China Telecom 3G (133, 153, 180, 181, 189), another card supports China Mobile or Chinese unicom 2G segment of the voice and SMS functions.

Third-party operator 170th code segment

add: China Unicom 4G 176, telecom 4G 177, Mobile 4G 178th segment

The regular expression functions written according to these are as follows:

Boolean Ismobileno (string mobiles) {2 string telregex = "13\\d{9}|14[57]\\d{8}|15[012356789]\\d{8}|18[ 01256789]\\D{8}|17[0678]\\D{8} ";  False;  Return mobiles.matches (Telregex);  5}       

which

"13\\d{9}" means the first two bits are 1 and 3, followed by any 9 bits;

"14[57]\\d{8}" means the first two bits are 1 and 4, the third digit is 5 or 7, followed by any 8 bits;

Mobile phone number regular expression in Android

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.