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}$/