| Character | Description |
|---|
| \ | Marks the next character as a special character, or a literal character, or a backward reference, or an octal escape character. For example, "n" matches the character "n". "\n" matches a newline character. The sequence "\\" matches "\" and "\(" matches "(". |
|---|
| ^ | The start position of the match input string. If the Multiline property of the RegExp object is set, ^ also matches the position after '\n' or' \r. |
|---|
| $ | Match the end position of the input string. If the Multiline property of the RegExp object is set, $also matches the position before "\n" or "\r. |
|---|
| * | Matches the preceding subexpression zero or more times. For example, zo * can match "z" as well as "zoo". * is equivalent to {0,}. |
|---|
| + | Matches the preceding subexpression one or more times. For example, "zo" can match "zo" as well as "zoo", but not "z". Equivalent to {1,}. |
|---|
| ? | Matches the preceding subexpression zero or once. For example, "do(es)?" can match "do" or "do" in "does".? Equivalent to {0,1}. |
|---|
| {n} | n is a non-negative integer. match the determined n times. For example, "o{2}" cannot match the "o" in "Bob", but it can match two o's in "food. |
|---|
| {n,} | n is a non-negative integer. Match at least n times. For example, "o{2,}" cannot match the "o" in "Bob", but it can match all o's in "foooood. "o{1,}" is equivalent to "o". "o{0,}" is equivalent to "o *". |
|---|
| {n,m} | Both m and n are non-negative integers, where n<= m. Match a minimum of n times and a maximum of m times. For example, "o{1,3}" would match the first three o's in "fooooood. "o{0,1}" is equivalent to "o?". Note that there can be no space between a comma and two numbers. |
|---|
| ? | When the character immediately follows any of the other restrictors (*, ,?,{n},{n,},{n,m}), the matching pattern is non-greedy. The non-greedy pattern matches the searched string as little as possible, while the default greedy pattern matches the searched string as much as possible. For example, for the string "oooo", "o?" would match a single "o", while "o" would match all "o". |
|---|
| . | Matches any single character except '\n. To match any character including '\n', use a pattern like' [.\n]. |
|---|
| (pattern) | Match the pattern and get the match. The obtained matches can be obtained from the generated Matches set, using the SubMatches set in the VBScript and the $0... $9 attribute in the JScript. To match parenthesis characters, use "\(" or "\)". |
|---|
| (?:pattern) | The match pattern but does not get the match result, that is, it is a non-get match and is not stored for later use. This is useful when using the or character "(|)" to combine parts of a pattern. For example, "industr(?:y | ies)" is a simpler expression than "industry | industries. |
|---|
| (?=pattern) | Forward prelookup, which matches the lookup string at the beginning of any matching pattern string. This is a non-fetching match, that is, the match does not need to be fetched for later use. For example, Windows(?= 95 | 98 | NT | 2000) matches Windows in Windows2000, but not Windows in Windows 3.1 ". The pre-check does not consume characters, that is, after a match occurs, the search for the next match starts immediately after the last match, rather than starting after the character that contains the pre-check. |
|---|
| (?!pattern) | Negative prelookup, which matches the search string at the beginning of any string that does not match the pattern. This is a non-fetching match, that is, the match does not need to be fetched for later use. For example, "Windows(?!95 | 98 | NT | 2000)" matches "Windows" in "Windows 3.1" but not "Windows" in "Windows2000". The pre-check does not consume characters, that is, after a match occurs, the search for the next match starts immediately after the last match, rather than starting after the character that contains the pre-check. |
|---|
| x|y | matches x or y. For example, "z | food" can match "z" or "food". "(z | f)ood" matches "zood" or "food". |
|---|
| [xyz] | A collection of characters. Matches any one of the contained characters. For example, "[abc]" can match the "a" in "plain". |
|---|
| [^xyz] | A set of characters with negative values. Matches any character not included. For example, "[^ abc]" can match the "p" in "plain". |
|---|
| [a-z] | A range of characters. Matches any character in the specified range. For example, "[a-z]" can match any lowercase alphabetic character in the range "a" to "z. |
|---|
| [^a-z] | Negative value character range. Matches any character that is not in the specified range. For example, "[^ a-z]" can match any arbitrary character not in the range "a" to "z. |
|---|
| \b | Match a word boundary, that is, the position between the word and the space. For example, "er \B" can match "er" in "never", but not "er" in "verb". |
|---|
| \B | Matches non-word boundaries. "er\B" can match "er" in "verb", but not "er" in "never". |
|---|
| \cx | Matches the control character indicated by x. For example,\cM matches a Control-M or carriage return. The value of x must be one of A- Z or a-z. Otherwise, c is treated as a literal "c" character. |
|---|
| \d | Matches a numeric character. Equivalent to [0-9]. |
|---|
| \D | Matches a non-numeric character. Equivalent to [^ 0-9]. |
|---|
| \f | Matches a page break. Equivalent to \x0c and \cL. |
|---|
| \n | Matches a line break. Equivalent to \x0a and \cJ. |
|---|
| \r | Matches a carriage return character. Equivalent to \x0d and \cM. |
|---|
| \s | Matches any white space characters, including spaces, tabs, page breaks, and so on. Equivalent to [\f\n\r\t\v]. |
|---|
| \S | Matches any non-white space character. Equivalent to [^\f\n\r\t\v]. |
|---|
| \t | Matches a tab. Equivalent to \x09 and \cI. |
|---|
| \v | Matches a vertical tab. Equivalent to \x0b and \cK. |
|---|
| \w | Matches any word character that includes an underscore. Equivalent to "[A-Za-z0-9_]". |
|---|
| \W | Matches any non-word character. Equivalent to "[^ A- Za-z0-9_]". |
|---|
| \xn | Matches n, where n is a hexadecimal escape value. The hexadecimal escape value must be two digits long. For example, "\x41" matches "A". "\x041" is equivalent to "\x04 & 1". ASCII encoding can be used in regular expressions.. |
|---|
| \num | Matches num, where num is a positive integer. A reference to the obtained match. For example, "(.)\1" matches two consecutive identical characters. |
|---|
| \n | Identifies an octal escape value or a backward reference. n is a backward reference if \n is preceded by at least n acquired subexpressions. Otherwise, if n is an octal digit (0-7), n is an octal escape value. |
|---|
| \nm | Identifies an octal escape value or a backward reference. If \nm is preceded by at least nm acquired subexpressions, then nm is a backward reference. If \nm is preceded by at least n acquisitions, then n is a backward reference followed by the literal m. If none of the preceding conditions are met, \nm will match the octal escape value nm if both n and m are octal digits (0-7). |
|---|
| \nml | If n is an octal digit (0-3), and both m and l are octal digits (0-7), the match octal escape value nml. |
|---|
| \un | Matches n, where n is a Unicode character represented by four hexadecimal digits. For example,\u00A9 matches the copyright symbol (?). |
|---|