Regex Explainer
Paste a regular expression and get a plain-English breakdown of every token — anchors, groups, classes, quantifiers and alternation. Runs in your browser.
Regular expression
Common flags: g global, i ignore case, m multiline, s dotall, u unicode.
Sample text (optional)
How it works
- Type a regular expression and click Explain.
- Each token is listed in order with a plain-English description.
- Add sample text to also see how many matches the pattern finds.
- Nothing is uploaded — the regex runs in your browser.
About the Regex Explainer
Regular expressions are dense: a ten-character pattern can encode anchors, a capturing group, a quantifier and a character class. Reading it back as prose is the fastest way to catch a misplaced quantifier or a group you forgot to close. This tool turns the pattern into an ordered list you can read top to bottom.
Use the optional sample text to confirm behaviour, not just structure. The explanation describes what each piece means; the live match count tells you whether the whole pattern does what you intended against real input.
How the explanation is built
The pattern is walked one token at a time, not by a full regex engine. At each position the tool identifies the longest construct starting there — a class, a group, a quantifier, an escape — and emits one plain-English sentence for it, then advances past that construct. That keeps the explanation readable and in document order.
Because it explains rather than compiles, the tool can describe a pattern even when it would be invalid in a strict engine. It will still flag the structural pieces it recognises; a genuinely malformed pattern simply yields fewer recognised tokens.
Groups and quantifiers
Capturing groups are numbered in the order their opening parenthesis appears, which is also how backreferences and replacement patterns count them. Non-capturing `(?:…)`, named `(?<name>…)`, and look-around `(?=…)`/`(?!…)`/`(?<=…)`/`(?<!…)` groups are labelled distinctly so you can see what participates in capture and what is pure assertion.
Quantifiers attach to whatever precedes them. The explainer lists each quantifier as a standalone note, and the live test shows whether the overall pattern actually matches — the two views together tell you what the quantifier means and whether it behaves as you expect.
Privacy and limits
Everything runs locally: the regex is compiled and tested by your browser's JavaScript engine, the sample text never leaves the page, and there is no server call or analytics beacon.
The explanation covers the common PCRE/JS feature set. Uncommon constructs such as conditional groups or atomic groups may not be expanded in detail; for those, treat the live match count as the source of truth and read the raw pattern to confirm.
Frequently Asked Questions
What does this explain?
Does it test the regex against my text?
Is my data sent to a server?
Do I need an account or API key?
Can I use these tools offline?
All processing happens in your browser. No uploads, no tracking, no servers. Your API keys, configs, and private payloads stay private — 100% client-side.