Regex Explainer
Explain a regular expression in plain English — a full sentence summary plus a token-by-token breakdown table (what each piece matches, and how). Supports the g/i/m/s/u flags and their effect on the explanation.
Input
Written without the surrounding slashes — e.g. \d+, not /\d+/.
Output
| Token | Kind | Meaning |
|---|---|---|
| No data yet | ||
Guides
The Regex Explainer turns a regular expression pattern into a plain-English description — so you (or a teammate) can understand what ^\d{3}-\d{4}$ actually matches without mentally decoding every anchor, class and quantifier. It's built for the moment you're staring at someone else's regex (or your own, six months later) and need to know what it does before you touch it.
How it works
Enter a pattern without the surrounding slashes — write \d+, not /\d+/ — and the tool parses its structure and produces two things:
- Plain-English Summary — one sentence describing the whole pattern in order, e.g. "Matches the start of the string, then any digit (0–9) — exactly 3 times, then the character "-", then any digit (0–9) — exactly 4 times, then the end of the string."
- Token-by-Token Breakdown — a table with one row per top-level component of the pattern: the exact token (
\d{3}), its kind (Quantified character shorthand), and its meaning in plain English. Groups, alternations and lookarounds get their contents spelled out inline, so a single row is a complete, self-contained explanation of that piece.
Five flag checkboxes mirror JavaScript's regex flags, and checking one doesn't just get mentioned — it changes the wording of the explanation itself: with m (multiline) checked, ^ and $ are explained as "the start/end of a line" instead of "the start/end of the string"; with s (dot-all) checked, . is explained as matching line breaks too.
If the pattern has invalid syntax, the error surfaces as a validation message on the pattern field instead of a blank result.
How to use it
- Enter your pattern in Regular Expression Pattern.
- Toggle any flags that apply.
- Read the one-line Plain-English Summary, or scan the Token-by-Token Breakdown table for a piece-by-piece explanation.
- Copy the summary, or copy/download the breakdown table as CSV, from the output card's actions.
Does this run my pattern against any text?
No. Unlike a regex tester, the Explainer never executes your pattern against a string — it only parses the pattern's own structure. That also means there's no catastrophic-backtracking ("ReDoS") risk to worry about: a pathological pattern like (a+)+b is explained just as instantly as a simple one, since nothing is ever matched. If you want to test a pattern against real text, use the Regex Tester instead.
How is this different from the Regex Cheatsheet?
The Regex Cheatsheet is a static reference table you search — useful for looking up what (?<=...) means in general. The Explainer instead parses your specific pattern and explains exactly what it does, token by token.
Does this run on your servers?
No — parsing happens entirely in your browser using the same JavaScript regex engine as the rest of the page. Your pattern is never sent anywhere unless you explicitly use the API.