Some characters in a regular expression have special meanings, and if you want to use its meaning in a match, you need to escape (precede it with a \). The following is a summary of some of the common special characters that need to be escaped: $ matches the end position of the input string. If the multiline property of the RegExp object is set, then $ also matches, such as ' \ n ' or ' \ R '. () marks the start and end position of a subexpression. The subexpression can be obtained for later use. To match these characters. * Match the preceding subexpression 0 or more times. + Match the preceding subexpression one or more times ... Matches any single character except the newline character \ n. [] marks the beginning of a bracket expression. Match the face expression 0 or more times, or indicate a non greedy qualifier \ mark the next character or special character or literal character or a back reference or octal escape character. For example: ' n ' matches the character ' n ' and ' \ n ' matches a newline character. The sequence ' \ \ ' matches ' ^ ' matches the starting position of the input string, unless used in a bracket expression, at which point he does not accept the character set. {} marks the beginning of a qualifier expression. | Indicates a choice between two items. General statement: *.? + $ ^ [] () {} | \/