Discover virtual mobile number for sms verification, include the articles, news, trends, analysis and practical advice about virtual mobile number for sms verification on alibabacloud.com
This article mainly introduces the Regular Expression of js verification phone number and mobile phone support + 86. For more information, see.
Regular Expression Verification
rules: Leave your email address in the "first part @ Second part"The first part: By letter, number, underline, short line "-", Dot "." CompositionPart two: For a domain name, the domain name consists of letters, numbers, short-term "-", the domain name suffix,and the domain name suffix is generally. xxx or. xxx.xx, a domain name suffix is generally 2-4-bit, such as cn,com,net, now the domain name will be more than 4 bitfunction Checkemail (str) {
For a long time before the use of regular validation, suddenly forget, and now again summed up1. Write a methodfunction isphoneavailable (q) {var myreg=/^[1][3,4,5,7,8][0-9]{9}$/;if (!myreg.test (q)) {return false;Alert ("Please enter the correct phone number!") ")$ ("#phone"). Val ("");} else {return true;}};2. Monitor the change of input box value$ ("#phone"). Change (function (e) {var StR = $ ("#phone"). Val ();Isphoneavailable (StR);});·········Ok
Recent project development encountered such a demand "mobile phone number or fixed at least one", as shown in the following figure:
The Jquery.validate.js validation component of the project, which currently does not support this "or" logical validation, defines a
JQuery.validator.addMethod ("Phone", function (value, Element) {var mobile = $ ("#
Copy codeThe Code is as follows:Function checkMobile (){Var sMobile = document. mobileform. mobile. valueIf (! (/^ 1 [3 | 4 | 5 | 8] [0-9] \ d {4, 8} $/. test (sMobile ))){Alert ("the first seven digits of a complete 11-digit mobile phone number or a correct mobile phone number
This article mainly introduces the JS verification phone number and mobile phone support +86 regular expression. Need friends can come to the reference, I hope to help you. The code is as follows: ; nbsp;
As mobile phone numbers are constantly updated, the previous regular expressions cannot meet the requirements. Recompile this expression, section data source basis: http://www.von-line.com/hao.htm
VaR RegEx = {Mobile:/^ 0? (13 [0-9] | 15 [012356789] | 18 [0236789] | 14 [57]) [0-9] {8} $ /}
Expression Analysis:"/" Represents a regular expression."^" Indicates the start position of the string, and "$" indic
Regular Expression ^ 1 [3 | 4 | 5 | 8] [0-9] \ D {4, 8} $
^ 1 indicates a Chinese mobile phone number starting with 1.[3 | 4 | 5 | 8] After 1, it can be a number of 3, 4, 5, or 8. If the phone number starting with 190 is displayed, the following is required: [3 | 4 | 5 | 8 | 9][0-9] indicates any
function Validatemobile (phone) { if (phone.length==0) { alert (' Please enter your phone number! '); Document.form1.phone.focus (); return false; } if (phone.length!=11) { alert (' Please enter a valid mobile number! '); Document.form1.phone.focus (); return false; }
PHP phone numbers Mobile number zip email verificationPhone number Verificationqh-Area code dh-Phonefunction Valitel (QH, DH){var re =/^ ([d]{3,5})? [-] ([d]{7,8}) $/;Return Re.test (QH + "-" + DH);}
Mobile phone number Verificationfunction Valimobile (SJ){var re =/^13[0-9]
Copy codeThe Code is as follows:// Regular Expression$ Tel = "15558530459"; // The author's mobile phone number, if you have any questions can contact me by phone, or QQ contact me, My QQ is mezongzi@qq.comIf (strlen ($ tel) = "11 "){// The above part determines whether the length is 11 characters long$ N = preg_match_all ("/13 [123569] {1} \ d {8} | 15 [1235689] \ d {8} | 188 \ d {8 }/", $ tel, $ array );/
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.