This article mainly introduces the Regular Expression of mobile phone numbers verified by js. If you need a friend, please refer to it. I hope to help you with the following regular expressions for mobile phone numbers verified by js. I have collected them from the Internet, but they are all excellent products, professional verification of mobile phone numbers and phone numbers.
Function checkPhone (phone) {// verify the phone number, which contains the if (phone = "") {alert ("phone number cannot be blank! "); Return false;} if (phone! = "") {Var p1 =/^ ([0 +] d {2, 3 }-)? (0d {2, 3 })-)? (D {7, 8}) (-(d {3 ,}))? $/; Var me = false; if (p1.test (phone) me = true; if (! Me) {// alert ('Sorry, www.jb51.net the phone number you entered is incorrect. Use-to separate the area code from the phone number); return false ;}} return true ;}
Mobile phone number verification
String. prototype. isTel = function () {// "compatible format: Country Code jb51.net (2 to 3 digits)-area code (2 to 3 digits)-telephone number (7 to 8 digits) -extension number (3 digits) "// return (/^ ([0 +] d {2, 3 }-)? (0d {2, 3 })-)? (D {7, 8}) (-(d {3 ,}))? $/. Test (this. Trim (); return (/^ ([0 +] d {2, 3 }-)? (0d {2, 3})-) (d {7, 8}) (-(d {3 ,}))? $/. Test (this. Trim ();} // verify the mobile phone number String. prototype. isMobile = function () {return (/^ (? : 13d | 15 [89])-? D {5} (d {3} | * {3}) $/. test (this. Trim ()));}
Phone number verification
Function CheckNum () {// call to verify var InputValue = document. gsjbxxBean. dh. value; var reg =/^ ([0-9] | [-]) + $/g; var isvalidisvalid1_reg.exe c (InputValue) if (! IsValid) {return false} return true}
Check the phone number
function isTel(str){var reg=/^([0-9][-])+$/g ;if(str.length<7 str.length>18){return false;}else{return reg.exec(str);}}
For more articles about the regular expression of mobile phone numbers verified by js, refer to PHP!