JavaScript Regular expression title case list

Source: Internet
Author: User

Regular expressions are important in JavaScript for character matching, substitution, and validation. Basic basics of getting started with regular expressions
     Regular Expression:  A Rule object,  can match our string to that rule and return true false          mode:   var reg = /Rule statement/;        reg.test (str);//Returns a Boolean type value         /.../    Start and end of the rule     ^       match the beginning of the string     $        end of Match string     ^C      must start with C      C$      must end with C               \d      Digital  [0-9]    \D       Non-digital  [^0-9]    \w      digital   Letter   Underline  [0-9a-zA-Z_]    \W      non-digital   letter   Underline  [^ 0-9a-za-z_]        {n}     matches the previous item n times     {n,}    matches the previous item at least n times     {n,m}   Match Previous Item n - m      *   any number of times     +   at least 1 times     ?  0-1          //next some of the topics are test   $ (function ()  {$ ("input[type= ' button ']"). Click (Function ()  {//4-6 digits and letters   //var reg1=/^[0-9a-za-z]{4,6}$/;//135 187 start with the phone number//var reg1=/^ (137| 187) [0-9]{8}$///6 bit ZIP code    initials cannot start with 0//VAR REG1=/^[1-9]{6}$///1 phone number//var reg1=/^1[0-9]{10}$/// User name 5--16 characters, including numbers, letters, underscores, the first must be the letter//var reg1=/^[a-za-z]\w{5,16}$///10-99//var reg1=/^[1-9][0-9]{2}$/// 0-120//var reg1=/^[0-9]$|^[1-9][0-9]$|^[1-9][0-1][1-9]$|^120$///is greater than or equal to 1 letters, numbers, underscores//var reg1=/^\w{3}$// /[email protected]var reg1=/^\w{3,}@[a-z]{1,}\. [A-z] {1,}$/var tex=$ ("input[type= ' text ']"). Val (); if (Reg1.test (Tex)) {ALert ("Match succeeded")}else{alert ("Match Failed")})})     check the records you have learned every day. Refueling         (as long as you do not give up, there is nothing to let oneself back, as long as strong enough, there is nothing to defeat themselves!) )


JavaScript Regular expression title case list

Related Article

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.