Skip to main content
QUIETLYTIC
Developer

Regex Explainer

Turn a regular expression into a plain-English, line-by-line breakdown.

Local · nothing leaves this browser Waiting for a pattern
Esc Clear
Breakdown

Type a pattern on the left.

How it works

Walks a JavaScript-flavour regular expression once and emits one plain-language line per construct: literal runs, character classes, quantifiers, groups (capturing, non-capturing, named, lookaround), anchors and alternation are each named individually and nested to match the pattern's own grouping.

Structure, not safety

This explains what a pattern matches, not whether it is efficient. It will correctly describe (a+)+ without flagging that the nesting is the classic catastrophic-backtracking shape — pair with the existing Regex Tester's own Web-Worker timeout check for that risk assessment.

Example

^\d{3}-\d{4}$ explains as: the start of the string, a digit repeated exactly 3 times, the text "-", a digit repeated exactly 4 times, and the end of the string — a US phone-number-style local pattern read back in full.

Frequently asked questions

Why does it group consecutive literal characters into one line?

A pattern like "hello" is five literal characters in a row, and explaining each individually ("the letter h", "the letter e", ...) would bury the one useful fact — that it matches the literal text "hello" — under noise. Runs of plain literals are grouped; anything with its own quantifier or meaning is broken out.

Does it tell me if my regex is dangerous?

No — that's the existing Regex Safety tool's job, which runs a pattern against a Web Worker with a timeout to catch catastrophic backtracking in practice. This tool only describes structure; a nested-quantifier pattern like (a+)+ is explained accurately without being flagged as risky.

Related tools

From the intelligence desk