Android: Regular expressions for verifying mobile numbers

Source: Internet
Author: User

http://blog.csdn.net/dai_zhenliang/article/details/8186249

1     /**2 * Verify phone format3      */4      Public Static BooleanIsmobileno (String mobiles) {5         /*6 Mobile: 134, 135, 136, 137, 138, 139, 150, 151, 157 (TD), 158, 159, 187, 1887 Unicom: 130, 131, 132, 152, 155, 156, 185, 1868 Telecom: 133, 153, 180, 189, (1349 Wei Tong)9 summing up is the first bit must be 1, the second must be 3 or 5 or 8, other locations can be 0-9Ten         */ OneString Telregex = "[1][358]\\d{9}";//"[1]" means the 1th digit is the number 1, "[358]" for the second can be 3, 5, 8, "\\d{9}" represents a number that can be 0~9, there are 9 bits.  A         if(Textutils.isempty (mobiles))return false; -         Else returnmobiles.matches (Telregex); -}

Android: Regular expressions for verifying mobile numbers

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.