Use and verify the regular expressions and JavaScript Regular Expressions of QQ numbers in javascript

Source: Internet
Author: User

Use and verify the regular expressions and JavaScript Regular Expressions of QQ numbers in javascript

I don't need to talk much about it. I just paste the Regular Expression Code to you.

Function myValid () {var errorMsg = ""; var res = true; // get the value to be verified. var upload ename = $ ("# upload ename "). val (); // name var receiveMobile =$ ("# tMobile "). val (); // mobile phone number var validCode = $ ("# validCode "). val (); // Verification Code var regName =/^ [\ ue-\ ufa] {,} $ /; // verify the name var regMobile =/^ [|] [-] \ d {}$ /; // verify the mobile phone var regCode =/^ \ d {}$/; // verification code if (! RegName. test (canonical ename) {errorMsg + = "the name format is incorrect; \ n \ r"; res = false;} if (! RegMobile. test (receiveMobile) {errorMsg + = "Incorrect mobile phone number format; \ n \ r"; res = false;} if (! RegCode. test (validCode) {errorMsg + = "enter a digit Verification Code; \ n \ r"; res = false;} if (! Res) {$. ligerDialog. error (errorMsg, "error prompt");} return res ;}

Below is a simple regular expression for verifying QQ numbers.

The Code is as follows:

[1-9] [0-9] {4 ,}

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.