Regex Explainer

Paste a regular expression (and optional flags) and a sample string. Every token of the pattern is shown with a plain-English description — anchors, classes, quantifiers, groups (including named and lookaround), alternation, backrefs, Unicode properties. The compiled regex is then run against the sample so the explainer and the actual matches stay in lockstep. Live, in your browser, no upload.

Pattern

Sample string

The compiled regex runs against this string. Matches show below the explanation.

Token breakdown

One row per token, in pattern order. Severity flags follow the explanation.

Diagnostics

Matches against the sample

Empty when the pattern is empty or invalid. Group positions are 0-based.

    Notes

    • Scope. This explainer targets the JavaScript RegExp surface. Atomic groups, possessive quantifiers, subroutine references, and recursive patterns are out of scope — the JS engine has none of those. POSIX classes ([[:alpha:]]) are not standard JS either.
    • Backtracking. Stacked quantifiers (**, +*) and a quantifier on a group that already contains a quantifier ((a+)+) are flagged. Other catastrophic shapes exist; this is a heuristic, not a guarantee.
    • Privacy. Pattern, flags, and sample string never leave your browser. The page works offline once loaded.
    • Related tools. Regex Tester highlights matches live and presets email / URL / UUID / IPv4 / hex colour. Regex Cheatsheet lists 24 common tokens with click-to-load examples.