Regex Explainer — Regular Expression in Plain English
Paste a regular expression and get a token-by-token explanation in plain English, a JavaScript validity check, capture groups and a live test.
Regular expressions are dense: a dozen characters can hide a lookahead, a lazy quantifier and two capture groups. This explainer breaks a pattern into its tokens and describes each one in plain English, indented to show which group it belongs to. It also tells you whether the pattern compiles in JavaScript, flags syntax that only works in PCRE, Python or Java, and runs it against a test string so you can see the match and every captured group.
How to use this tool
- Paste the pattern — either bare, like \d{3}-\d{4}, or as a JavaScript literal such as /\d+/gi.
- Add flags if they are not part of a literal.
- Optionally type a test string to see the first match and its groups.
- Press Calculate. Read the explanation table from top to bottom; indented rows are inside a group.
Formula
Pattern → tokens (literals, escapes, classes, groups, quantifiers, anchors, alternation) → one plain-English line each.
Quantifiers such as {2,} or +? get their own row and always apply to the item just above them. The validity check uses your browser's own engine (new RegExp), so "Works in JavaScript: Yes" means the pattern really compiles there. Unicode-set and scoped-modifier patterns are outside this tokenizer’s coverage; use Regex to English for them. Calculation runs in a worker and stops after two seconds.
Example
The default email pattern ^(?<user>[\w.+-]+)@((?:[A-Za-z0-9-]+\.)+[A-Za-z]{2,})$ is explained as: start of string; capturing group 1 named "user" holding one or more word characters, dots, pluses or hyphens; an "@"; capturing group 2 holding one or more "label plus dot" repeats and two or more letters; end of string. It has 2 capturing groups, and on ada.lovelace+news@example.co.uk group 1 captures ada.lovelace+news and group 2 example.co.uk.
Frequently asked questions
Which regex flavour does it explain?
JavaScript is the reference, since that is what your browser runs. Common PCRE, Python and Java syntax — atomic groups, possessive quantifiers, \A, (?P<name>…), inline (?i) — is recognised and labelled as not available in JavaScript.
Why does it say "Works in JavaScript: Yes" for \A?
Without the u flag, JavaScript treats an unknown escape like \A as the plain letter A, so the pattern compiles but means something different. The explanation warns about this.
Does it explain what text the regex will match?
It explains each token, which together describe the rule. To see real behaviour, use the test string: the first match and every capture group are shown.
Is my pattern sent anywhere?
No. The tokenizer and the test both run locally in your browser.
Sources
Last updated: 2026-10-30