Advanced Notes (2)--javascript fine crushed

Source: Internet
Author: User

Regular/Regular Expressions/

^ denotes string start

(? :... ) represents a non-capturing grouping (not much meaning)

Suffix? Indicates a match 0 or 1 times

( ... ) represents a capturing type grouping

[^] means beyond []

* Match 0 or more times

+ Match 1 shipments multiple times

[Character class] matches by "character class"

/I is case insensitive

/g Global match

/m multi-line matching

$ match End

Regexp

New a RegExp object that accepts two parameters (one is the string pattern to match and the other is an optional flag string.) Because the schema parameter of the RegExp constructor is a string, in some cases multiple escapes of the character, all metacharacters must be escaped, and those characters that have escaped are also the same) for example:

Literal pattern/\[bc\]at/equivalent string is "\\[bc\\]at"

Regular expression selection: A regular expression contains one or more expressions, with | Separate if matches match one of the expression requirements

Advanced Notes (2)--javascript fine crushed

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.