Regex Tester with Plain-English Explainer

Test regular expressions live and see them explained in plain English.

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

Test regular expressions and understand them

This tester highlights every match live as you type and gives a plain-English, step-by-step explanation of what each part of your pattern does — something most regex tools skip. It is built for developers writing and debugging patterns, and for anyone learning regex who wants to know why a pattern matches.

How it works

Your pattern and flags are compiled with the browser’s native new RegExp(pattern, flags) — the exact JavaScript engine your code will use, so behaviour matches production. For highlighting, the tester forces the global flag (g) internally and runs test.replace(regex, ...) to wrap every match in a highlight, even if you didn’t type g. If the pattern is invalid, the RegExp constructor’s error is shown instead. Separately, a lightweight tokeniser walks the pattern left to right and emits a sentence per token (character class, quantifier, anchor, group, alternation, and so on) for the explanation panel.

Example

Pattern \b\d{4}-\d{2}-\d{2}\b with the g flag, tested against:

Invoices dated 2026-05-30 and 2026-06-01 are due.

highlights both 2026-05-30 and 2026-06-01. The explainer breaks it down as: word boundary, four digits, a literal hyphen, two digits, a hyphen, two digits, word boundary — i.e. an ISO-style date.

Flag reference

FlagNameEffect
gglobalMatch every occurrence, not just the first
iignore caseCase-insensitive matching
mmultiline^ and $ match at each line break
sdotall. also matches newline characters

Everything runs locally in your browser — your pattern and text are never uploaded.

Ad placeholder (rectangle)