Regex Explainer

Paste a regex and get a token-by-token, plain-English breakdown of every anchor, character class, quantifier, group, and alternation. It also flags patterns that won’t compile.

This regex explainer walks through a pattern one piece at a time and says, in plain English, what each part matches. Paste a bare pattern or a full /pattern/flags literal and it labels every anchor, character class, quantifier, group, and alternation, so you can explain regex you didn’t write. Think of it as a regex to English translator that also flags when a pattern won’t compile. Nothing is sent to a server; the regular expression explainer runs in your browser as you type.

Token breakdown (16)
  1. ^AnchorAssert the start of the string (or line in multiline mode).
  2. (GroupStart of capturing group 1 (the match here is saved).
  3. \dCharacter classMatch any digit, 0 to 9.
  4. {4}QuantifierRepeat the preceding item exactly 4 times.
  5. )GroupEnd of the group.
  6. -LiteralMatch the literal character "-".
  7. (GroupStart of capturing group 2 (the match here is saved).
  8. \dCharacter classMatch any digit, 0 to 9.
  9. {2}QuantifierRepeat the preceding item exactly 2 times.
  10. )GroupEnd of the group.
  11. -LiteralMatch the literal character "-".
  12. (GroupStart of capturing group 3 (the match here is saved).
  13. \dCharacter classMatch any digit, 0 to 9.
  14. {2}QuantifierRepeat the preceding item exactly 2 times.
  15. )GroupEnd of the group.
  16. $AnchorAssert the end of the string (or line in multiline mode).

How it works

  1. 1

    Paste your pattern

    Enter a regex on its own or as a /pattern/flags literal. Flags are detected and described too.

  2. 2

    Read it token by token

    Each construct gets a row: the exact text, its category, and a sentence on what it does.

  3. 3

    Copy the explanation

    Grab the whole plain-English breakdown with one click to drop into a code comment or a review.

Instant & 100% private — nothing is uploaded

Everything runs locally in your browser. Your code, text and files are processed on your own device and are never sent to a server — so there are no upload waits, no size limits from us, and nothing is ever stored or logged.

Frequently asked questions

What kinds of regex can it explain?
Standard JavaScript-style patterns: anchors, shorthand and custom character classes, quantifiers, capturing and non-capturing groups, named groups, lookahead and lookbehind, alternation, and backreferences.
Does it check whether my regex is valid?
Yes. It compiles the pattern with the JavaScript engine and warns you about a syntax error, while still giving a best-effort breakdown of the tokens it can read.
Can I paste a /pattern/flags literal?
You can. The regex explainer pulls the pattern and flags apart, describes each flag like g or i, then explains the pattern itself.
Is this the same as testing a regex against text?
No. This is a regex to English tool that describes the pattern. It doesn’t run your regex against sample input; it explains what the pattern would match.
Why would I need a regular expression explainer?
Regex is dense and easy to misread. Turning it into sentences helps when you’re reviewing someone’s pattern, learning the syntax, or trying to remember what an old expression of your own actually does.