← All references

Regex Cheatsheet

Common regular-expression tokens and patterns with readable explanations. Use the search field to quickly narrow this reference.

ValueName / formMeaning
.Any characterMatches one character except a line break by default.
\dDigitMatches 0 through 9.
\wWord characterMatches letters, digits, and underscore.
\sWhitespaceMatches spaces, tabs, and line breaks.
^ / $AnchorsMatch the beginning or end of input.
* / + / ?QuantifiersMatch zero or more, one or more, or zero or one.
{n,m}RangeMatch between n and m repetitions.
[abc]Character classMatch one listed character.
[^abc]Negated classMatch a character not in the list.
(abc)Capture groupGroup and capture the matched substring.
(?:abc)Non-capturing groupGroup without creating a capture.
a|bAlternationMatch a or b.

How to use this reference

Search by a value, name, or keyword. The table is designed as a quick reminder while you code, debug, or review documentation. Examples are intentionally compact; verify environment-specific behavior in the official documentation for the platform you are using.