A two-in-one regex workbench: a categorized cheatsheet of every common regular-expression token, paired with a live tester that highlights matches as you type. It is built for developers writing validation rules, data-extraction scripts or search-and-replace patterns, and for anyone learning regex who wants instant feedback instead of guessing.
How it works
The tester uses your browser’s native RegExp engine, so the behaviour matches exactly what
your JavaScript or TypeScript code will do at runtime. Type a pattern, tick the flags you want,
and paste a test string. The tool compiles the pattern; if it is valid it scans the whole test
string, highlights every match, and fills a results table with each match, its character
index and the contents of any capturing groups. If the pattern cannot be compiled, the exact
engine error is shown so you can fix it on the spot. Matching always runs globally internally so
you can see all matches at once, while still honouring the case, multiline and dotAll flags you
choose.
The cheatsheet below the tester groups tokens into the way people actually think about them:
character classes, anchors and word boundaries, quantifiers, groups and alternation, look-around
assertions, and escapes. Each row has a plain-English explanation and a copy button, and a
search box filters all categories at once — type boundary, lazy or digit and only the
relevant rows remain. Because everything runs client-side, you can test patterns against
sensitive data without anything leaving your machine.
Example
Suppose you want to pull email addresses out of a paragraph. Enter the pattern
\b[\w.+-]+@[\w-]+\.[\w.-]+\b with the g flag and paste a sentence containing a couple of
addresses. The tester highlights each address in the text and lists them in the table with their
positions. Switch on the i flag and uppercase addresses match too. Want only the domain part?
Wrap it in a group — @([\w.-]+) — and the captured domain appears in the Groups column for
every match. Swap a greedy .* for a lazy .*? inside delimiters and watch the highlighted span
shrink to the shortest possible match.
| Goal | Pattern | Flags |
|---|---|---|
| Match a date like 2026-05-30 | \d{4}-\d{2}-\d{2} | g |
| Find words at line starts | ^\w+ | gm |
| Match text between quotes (lazy) | "(.*?)" | g |
| UK postcode-ish fragment | [A-Z]{1,2}\d[A-Z\d]? | gi |
Every keystroke recompiles and re-matches in your browser — no network calls, no storage.