💬Regex Plain-Words Explainer

Token-by-token notes within a stated scope

What this tool reads

Reads: literal characters, character classes [...] and negated classes, \d \w \s and their negated forms, quantifiers * + ? {n} {n,} {n,m} with lazy variants, anchors ^ $ \b \B, groups ( ) (?: ) (?<name> ), lookahead (?= ) (?! ), alternation |, and the flags g i m s u y.

Does not read: lookbehind (?<= ) (?<! ), backreferences \1 \k<name>, conditionals, recursion, Unicode property escapes \p{...} and atomic groups. Those are marked as left unexplained rather than guessed. Atomic groups, conditionals and recursion are rejected outright by the JavaScript regex engine as syntax errors.

You Might Also Need

It reads the pattern token by token

Paste a pattern and it is first compiled as a JavaScript regular expression to confirm the syntax. If it compiles, the pattern is split from the front into tokens and each piece gets its own line of explanation. Flags are broken out into their own table, and meanings that depend on a flag are reflected: with the m flag, for instance, the notes for ^ and $ switch to per-line wording. Capture groups are numbered and named in the order they appear.

The reading scope is pinned down in code

Explaining every regular expression needs a complete parser, so this tool fixes the constructs it reads as an explicit list in code. Lookbehind, backreferences, conditionals, recursion, Unicode property escapes and atomic groups are not read; they are marked as left unexplained, and a warning appears above the summary whenever one shows up. The choice is deliberate: a confident wrong explanation is worse than a gap. Checked October 2026.

Limits and what it will not do

The output stops at per-token meaning. It does not condense the whole pattern into one sentence, generate strings that would match, or diagnose performance. The reference engine is the browser JavaScript regex engine, so Python, Java and PCRE may accept constructs it rejects. When a pattern fails to compile, the message from the engine is shown as it came back.

Frequently Asked Questions

Why is lookbehind not explained?

Constructs such as lookbehind, backreferences and conditionals only take on meaning once the surrounding context is tracked, so explaining them from a token alone risks being wrong. They are marked as left unexplained and a warning is shown instead of a guess.

Should I include the surrounding slashes?

No. For /ab+c/gi put ab+c in the pattern box and gi in the flags box. If the slashes are included they are read as literal slash characters.

What does this tool not do?

It does not run the pattern against sample text. Match testing belongs to a regex tester, and replacement previews to a regex replace tool.