DEVELOPER & DATA

Regex Explainer

Paste a regular expression and read it in plain English, part by part: groups, classes, quantifiers, anchors, lookarounds, flags — hazards flagged.

A line-by-line explanation of the pattern from its grammar (no AI), the group count and names, what each flag does, and warnings such as nested unbounded repeats or a greedy ".*".

Example: ^(?<user>[\w.+-]+)@([a-z0-9-]+\.)+[a-z]{2,}$ reads as: start; named group "user" of word characters, dots, plus or minus; "@"; one or more of (letters, digits or hyphens then a dot); 2+ letters; end.

v0.1.0 · last reviewed 20 September 2026
Loading the workspace…
BUILT TO BE UNDERSTOOD

Read the pattern
the way the engine does.

How the pattern is parsed, where the words come from, and which hazards are pointed out.

Parsing

The pattern is parsed with a small recursive-descent parser for the ECMAScript grammar: alternation, sequences, groups (capturing, named, non-capturing, lookahead, lookbehind), character classes with ranges and negation, escapes (\d \w \s \b, hex and unicode, control, back-references), anchors, the dot, and quantifiers with lazy variants. It is first compiled with the browser's own RegExp so a genuinely invalid pattern reports the engine's error, not a guess.

The explanations

Every sentence is attached to a grammar rule — "one character from the set", "zero or more times, as many as possible" — and assembled from the tree, with a quantified group shown on one line and its contents indented beneath. There is no language model involved; the same pattern always gives the same words, and a construct the parser does not know is reported rather than paraphrased.

Hazards

Two warnings are about performance: a repeated group that itself contains an unbounded repeat ((a+)+) can backtrack exponentially on non-matching input, and a greedy ".*" grabs as much as possible before backtracking. Two are about intent: a pattern without ^ … $ matches anywhere, and a bare | matches the empty string. They are hints, not verdicts. Nothing leaves the browser; the same four anonymous usage counts as the rest of the site apply.

SOURCES

Last reviewed 20 September 2026. How results are checked: How we verify.