This page provides an overall cheat sheet of all the capabilities of RegExp
syntax by aggregating the content of the articles in the RegExp
guide. If you need more information on a specific topic, please follow the link on the corresponding heading to access the full article or head to the guide.
Character classes
Characters | Meaning |
---|---|
. |
Has one of the following meanings:
Note that the ES2018 added the |
d |
Matches any digit (Arabic numeral). Equivalent to |
D |
Matches any character that is not a digit (Arabic numeral). Equivalent to |
w |
Matches any alphanumeric character from the basic Latin alphabet, including the underscore. Equivalent to |
W |
Matches any character that is not a word character from the basic Latin alphabet. Equivalent to |
s |
Matches a single white space character, including space, tab, form feed, line feed, and other Unicode spaces. Equivalent to |
S |
Matches a single character other than white space. Equivalent to |
|
Matches a horizontal tab. |
|
Matches a carriage return. |
|
Matches a linefeed. |
v |
Matches a vertical tab. |
f |
Matches a form-feed. |
[] |
Matches a backspace. If you're looking for the word-boundary character ( ), see Boundaries. |
|