Regex Syntax Reference

Searchable cheat sheet of regular-expression tokens, quantifiers and flags.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

A searchable cheat sheet for regular expressions — character classes, anchors, quantifiers, groups, alternation, lookaround, and flags — each with a plain-English meaning. It is handy when you are mid-pattern and just need to recall what \b, *?, or (?<=...) does without leaving your work.

How it works

The reference groups every common regex token by category — character classes, anchors, quantifiers, groups, lookaround, and flags — and shows a concise description of what each matches. Type a token or keyword such as digit, lookahead, or quantifier into the search box and the list filters instantly to the matching entries. It is purely a static lookup that follows the conventions shared by JavaScript and PCRE, so nothing is executed against your data.

Example

Searching for digit surfaces the character-class tokens. A few of the most-used tokens:

TokenMatches
.Any character except newline
\d / \DA digit / a non-digit
\w / \WA word character / non-word character
\s / \SWhitespace / non-whitespace
^ / $Start / end of string (or line with m)
\bWord boundary
* + ?0+, 1+, 0 or 1 (add ? for lazy)
{n,m}Between n and m repetitions
(?=...) / (?!...)Positive / negative lookahead
(?<=...) / (?<!...)Positive / negative lookbehind

Everything runs in your browser; nothing is uploaded.

Ad placeholder (rectangle)