Regex Cheat Sheet

A quick reference to regular-expression syntax — the tokens, classes and quantifiers.

The syntax, in one place

Regular expressions have a lot of small pieces — character classes, anchors, quantifiers, groups, look-arounds — and even people who use them regularly forget the exact syntax for the less-common ones. This is a reference that lays out the tokens and what each does, so you can look up the piece you need instead of hunting through documentation.

Browse the syntax reference for the tokens you need.

Reference, then test

A cheat sheet gets you the right token; testing gets you the right pattern. The reliable workflow is to look up the syntax here, then build the expression against real examples in a tester, checking it matches what you intend and rejects what you do not. Regex is notorious for patterns that look right but behave unexpectedly on edge cases, so the reference and a live tester together — one for the vocabulary, one for verifying the sentence — is how you write patterns that actually work rather than ones that look plausible.

Questions & answers

What does the cheat sheet cover?

The regex building blocks — character classes, anchors, quantifiers, groups and look-arounds — and what each does.

How should I use it?

Look up the syntax you need, then build and verify the full pattern against real examples in a tester.

Is anything uploaded?

No. It is a reference that runs in your browser.

More Developer tools