Regular expressions in JavaScript using and verifying the regular _ regular expressions of QQ numbers

Source: Internet
Author: User

No more nonsense to say, directly to everyone paste regular expression code.

 function Myvalid () {
   var errormsg = "";
   var res = true;
   Get the value you want to validate.
   var receivename = $ ("#receiveName"). Val ();//Name
   var receivemobile = $ ("#tMobile"). Val ()/mobile number
   var Validcode = $ ( "#validCode"). Val ()//Verification code
   var regname =/^[\ue-\ufa]{,}$/;//authentication name
   var regmobile =/^[| | | | [-]\d{}$/;//Verification mobile phone
   var regcode =/^\d{}$/;//Authentication Code
   if (!regname.test (Receivename)) {
   errormsg = "name format is not correct; \ n \ r ";
   res = false;
   if (!regmobile.test (Receivemobile)) {
   errormsg + = "Cell phone number format is not correct; \n\r";
   res = false;
   if (!regcode.test (Validcode)) {
   errormsg = "Please enter a bit of digital verification code; \n\r"
   ; res = false;
   if (!res) {
   $.ligerdialog.error (errormsg, error hint);
   }
   return res;
 }

Share a very simple regular expression that verifies the QQ number.

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.