Some special characters in regular expressions need to be escaped before they match, so here's a summary.
Special characters
Description
$ matches the end position of the input string. If the Multiline property of the RegExp object is set, then $ also matches ' \ n ' or ' \ R '. To match the $ character itself, use \$.
() marks the start and end position of a subexpression. The subexpression can be obtained for later use. To match these characters, use \ (and \).
* Match the preceding subexpression 0 or more times. To match the * character, use \*.
+ matches the preceding subexpression one or more times. to match the + character, use \+.
. Matches any single character except the newline character \ n. to match., please use \.
[] marks the beginning of a bracket expression. To match [, use \[.
? Matches the preceding subexpression 0 or more times, or indicates a non-greedy qualifier. Want to match? characters, please use \?.
\ marks the next character as either a special character, or a literal character, or a backward reference, or a octal escape character. For example, ' n ' matches the character ' n '. ' \ n ' matches line breaks. The sequence ' \ \ ' matches ' \ ' and ' \ (' matches '.
^ matches the starting position of the input string, unless used in a bracket expression, at which point it means that the character set is not accepted. To match the ^ character itself, use \^.
{} marks the beginning of a qualifier expression. To match {, use \{.
| Indicates a choice between two items. to match |, use \|.