Javascript-obtain the complete regular expression for the mobile phone number

Source: Internet
Author: User
For the complete regular expression of the mobile phone number. for the full regular expression of the mobile phone number

Reply content:

For the complete regular expression of the mobile phone number

^ 13 [0-9] {9} | 15012356789 {8} | 180256789 {8} | 147 [0-9] {8} $

/^ (13 | 8) | 14 [5 | 7] | 15 [0-3 | 5-9] | 17 [3 | 6-8]) d {8} $/

/^(13[0-9]|15[012356789]|17[0678]|18[0-9]|14[57])[0-9]{8}$/

PHP:

function checkphone($phone){    if(preg_match("/1[3458]{1}\d{9}$/",$phone)){          return true;    }else{        return false;    }}

/^ (+? 0? 86 -?)? 1 [345789] d {9} $/

Var checkPhoneNumber = function (mobile ){

var reg= /^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/;return reg.test(mobile);

}

It seems that it is the same as @ zealyw...

var reg = /^(13[0-9]|15[0-35-9]|18[0-9]|17[06-8]|14[57])\d{8}$/

Https://gist.github.com/yuezk...

Now the mobile phone number may not start with 1.

$ Reg = "/^ 1 (3 [0-9] | 4 [57] | 5 [0-35-9] | 8 [0-9] | 70) \ d {8 }$ /";

$ RegForYD = "/(^ 1 (3 [4-9] | 4 [7] | 5 [0-27-9] | 7 [8] | 8 [2-478 ]) \ d {8} $) | (^ 1705 \ d {7} $ )/"; // move $ regForLT = "/(^ 1 (3 [0-2] | 4 [5] | 5 [56] | 7 [6] | 8 [56]) \ d {8} $) | (^ 1709 \ d {7} $ )/"; // Unicom $ regForDX = "/(^ 1 (33 | 53 | 77 | 8 [019]) \ d {8} $) | (^ 1700 \ d {7} $)/"; // telecom if (preg_match ($ reg, $ phone) | preg_match ($ regForYD, $ phone) | preg_match ($ regForLT, $ phone) | preg_match ($ regForDX, $ phone) return true; return false;

/^((\(\d{3}\))|(\d{3}\-))?(\(0\d{2,3}\)|0\d{2,3}-)?[1-9]\d{6,7}$/

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.