Special characters
Many metacharacters require special processing when trying to match them. To match these special characters, you must first escape these characters, that is, use a backslash (). The following table lists the special characters and their meanings:
Special characters
$ Matches the end position of the input string. If the Multiline of the RegExp object is set
$ Also matches ''or ''. To match the $ character, use $.
() Mark the start and end positions of a subexpression. Subexpressions can be obtained for future use.
To match these characters, use (and ).
* Matches the previous subexpression zero or multiple times. To match * characters, use *.
+ Match the previous subexpression once or multiple times. To match + characters, use +.
. Match any single character except line breaks. To match., use.
Mark the start of a bracket expression. To match [, use [.
? Match the previous subexpression zero or once, or specify a non-Greedy qualifier. To match?
Character, please use ?.
Mark the next character as or a special character, or a literal character, or backward reference, or octal character
Escape Character. For example, 'n' matches the character 'n '. ''Matches the linefeed. Sequence''
Match "", while '(' matches "(".
^ Matches the start position of the input string unless used in the square brackets expression.
This character set combination is not accepted. To match the ^ character itself, use ^.
{Mark the start of the qualifier expression. To match {, use {.
| Specify an option between the two items. To match |, use |.