Regex Explainer

Paste a regular expression and get a plain-English breakdown of every token — anchors, groups, classes, quantifiers and alternation. Runs in your browser.

Regular expression

Common flags: g global, i ignore case, m multiline, s dotall, u unicode.

Sample text (optional)

How it works

About the Regex Explainer

Regular expressions are dense: a ten-character pattern can encode anchors, a capturing group, a quantifier and a character class. Reading it back as prose is the fastest way to catch a misplaced quantifier or a group you forgot to close. This tool turns the pattern into an ordered list you can read top to bottom.

Use the optional sample text to confirm behaviour, not just structure. The explanation describes what each piece means; the live match count tells you whether the whole pattern does what you intended against real input.

How the explanation is built

The pattern is walked one token at a time, not by a full regex engine. At each position the tool identifies the longest construct starting there — a class, a group, a quantifier, an escape — and emits one plain-English sentence for it, then advances past that construct. That keeps the explanation readable and in document order.

Because it explains rather than compiles, the tool can describe a pattern even when it would be invalid in a strict engine. It will still flag the structural pieces it recognises; a genuinely malformed pattern simply yields fewer recognised tokens.

Groups and quantifiers

Capturing groups are numbered in the order their opening parenthesis appears, which is also how backreferences and replacement patterns count them. Non-capturing `(?:…)`, named `(?<name>…)`, and look-around `(?=…)`/`(?!…)`/`(?<=…)`/`(?<!…)` groups are labelled distinctly so you can see what participates in capture and what is pure assertion.

Quantifiers attach to whatever precedes them. The explainer lists each quantifier as a standalone note, and the live test shows whether the overall pattern actually matches — the two views together tell you what the quantifier means and whether it behaves as you expect.

Privacy and limits

Everything runs locally: the regex is compiled and tested by your browser's JavaScript engine, the sample text never leaves the page, and there is no server call or analytics beacon.

The explanation covers the common PCRE/JS feature set. Uncommon constructs such as conditional groups or atomic groups may not be expanded in detail; for those, treat the live match count as the source of truth and read the raw pattern to confirm.

Frequently Asked Questions

What does this explain?
Every token in the pattern: anchors (^ $), character classes ([a-z], [^0-9]), escapes (\d \w \s \b and escaped literals), quantifiers (* + ? {n,m}), groups — capturing, non-capturing, named, and look-around — alternation (|), backreferences, and literal characters. It explains structure, it does not execute the pattern.
Does it test the regex against my text?
Yes — if you provide sample text, the tool runs the pattern with the JS regex engine and reports how many matches it found plus the first few captured spans. The explanation and the live test use the same pattern and flags, so they stay consistent.
Is my data sent to a server?
No. Every tool on jsonversal runs entirely in your browser using the Web Crypto API, File API, and Clipboard API. Nothing is ever uploaded — not even the JSON you paste in.
Do I need an account or API key?
No signup, no email, no API key. All tools are free to use with no signup required.
Can I use these tools offline?
Yes. Once the page loads, all tools work offline. There are no external API calls or CDN dependencies at runtime.
🔒
Your data never leaves your device

All processing happens in your browser. No uploads, no tracking, no servers. Your API keys, configs, and private payloads stay private — 100% client-side.

esc
↑↓ navigate ↵ open esc close