↑ arvau

MDN / Regular expression syntax cheat sheet

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

Character classes distinguish kinds of characters such as, for example, distinguishing between letters and digits.

Assertions

Assertions include boundaries, which indicate the beginnings and endings of lines and words, and other patterns indicating in some way that a match is possible (including look-ahead, look-behind, and conditional expressions).

Boundary-type assertions

Other assertions

The ? character may also be used as a quantifier.

Groups and backreferences

Groups and backreferences indicate groups of expression characters.

Quantifiers

Quantifiers indicate numbers of characters or expressions to match.

In the following, item refers not only to singular characters, but also includes character classes and groups and backreferences.