Regex Explainer
Turn a regular expression into a plain-English, line-by-line 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
Regex Tester
Test a pattern against sample text with a hard execution timeout.
LocalJSON Formatter & Validator
Format, validate and measure JSON, with errors located by line and column.
LocalSQL Formatter
Reflow a SQL query onto readable lines, one clause per line.
LocalcURL Converter
Turn a pasted curl command into a fetch call or Python requests snippet.
LocalTimezone Converter
Convert a date and time between IANA time zones, or find the gap between two instants.
LocalJSON Schema Validator
Validate a JSON document against a JSON Schema and see exactly which rule failed, and where.
Local