Use of JS Regular expressions

Source: Internet
Author: User
Tags alphabetic character

The characters commonly used character of the regular expression:

Symbol Describe
/.. / Represents the beginning and end of a pattern
^ Match the start of a string
$ Match the end of a string
\s Any whitespace character
\s Any non-whitespace character
\d Matches a numeric character, equivalent to [1-9]
\d Any character other than a number, equivalent to [^0-9]
\w Match a number, underscore, or alphabetic character, equivalent to [a-za-z0-9]
\w Any non-single character, equivalent to [^a-za-z0-9]
.

Any character other than line breaks

Repeating characters for regular expressions

Symbol Describe
N Matches the previous n times
{N,} Matches the previous item n times, or multiple times
{N,m} Match the previous item at least n times, but not more than m times
* Matches the previous item 0 or more times, equivalent to {0,}
+ Matches the previous item 1 or more times, equivalent to {1,}
? Matches the previous item 0 or 1 times, which means the previous item is optional, equivalent to {0,1}

Use of JS Regular expressions

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.