RegExp type of JavaScript reference type (regular expression)

Source: Internet
Author: User

The ECMAScript uses RegExp to support regular expressions. Using the following Perl-like syntax, you can create a regular expression.

var  Expression=/pattern/flags;

As above code:

The pattern---pattern section can be any simple or complex regular expression that can contain character classes, qualifiers, groupings, forward lookups, and reverse references.

Falgs---each regular expression can have one or more flags (flags) that indicate the behavior of the regular expression;

The following are the 3 flags supported by the matching pattern of the regular expression:

G: Represents the global pattern, which means that the pattern will be applied to all strings, rather than stopping immediately when the first occurrence is found;

I: Indicates case-insensitive mode, that is, the case of the pattern and the string are ignored when the match is determined;

M: represents multiline mode, that is, when you reach the end of a line of text, you also continue to find out if the next row has an item that matches the pattern

RegExp type of JavaScript reference type (regular expression)

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.