Divided into literal and regexp constructors
1, regular expression matching mode support 3 flags
G: Represents the global pattern, and the pattern is applied to all strings, not immediately when the first match is found
I: Indicates case-insensitive mode, which ignores pattern and string case when determining matches
M: Represents a multiline pattern that, when the end of a line of text is reached, continues to find out if there are items in the next row that match the pattern.
RegExp Instance Properties
Global: Indicates the G flag is set
Ignorecase:i
Multiline:m
LastIndex: Integer that represents the character position at which to start searching for the next occurrence, starting from 0
Source: A string representation of a regular expression that is returned in literal form rather than in the string pattern in the incoming constructor.
RegExp instance method
EXEC () is specifically designed for capturing groups. parameter is the string to which the pattern is to be applied, and then returns an array containing the first occurrence information, or null if no match is found. The returned array, although an instance of array, contains two additional attributes. Index represents the position of the match in the string, and input represents the string that applies the regular expression.
Look at the headache, this piece does not understand, see later.
The regexp of JavaScript