Regex Explainer
See what each part of a regular expression means, explained in plain language.
Enter a pattern above and press Explain. Escapes like \d and \b are supported.
The pattern is tokenized in your browser and validated with the JavaScript engine. Nothing is sent anywhere, and no text is matched — this tool only explains.
How to use it
- Type the pattern without the surrounding slashes, for example
(\d{4})-(\d{2}). - Set the flags you care about — g, i, m, s, u, y — and the flag list explains what each one does.
- The Highlighted pattern row colors every part by its role: anchors, classes, groups, quantifiers, alternation.
- The What each part means list explains each token in order, including lazy and possessive quantifier suffixes.
- Invalid patterns are rejected with the engine's own message, so you can see exactly what failed.
Common use cases
- Reading a pattern you inherited — understand a regex from a codebase before changing it.
- Learning regex — see how anchors, classes, groups and assertions combine in real patterns.
- Reviewing pull requests — check what a new pattern actually claims to match, claim by claim.
- Debugging quantifiers — tell greedy, lazy and possessive behavior apart at a glance.
Why it stays private
The pattern is tokenized in your browser and validated with the JavaScript engine. Nothing is uploaded, and no text is matched against the pattern — this tool only explains, it never sees your data.
FAQ
Q: Does it test my pattern against text? A: No. It explains the pattern only. For matching and replacing, use the regex tester tool on this site.
Q: What if my pattern is valid in another language but not in JavaScript? A: The check uses the JavaScript engine, so a pattern that fails here may still work in PCRE or Python. The error message comes from that engine and says what it rejected.
Q: How are backreferences and named groups shown? A: Backreferences appear as a reference to an earlier capture group, and named groups are labeled with their name. Group contents are listed token by token, not nested visually.
Q: Are lookarounds explained? A: Yes — positive and negative lookahead and lookbehind each get their own explanation, including the fact that they match without consuming characters.
Your data stays on this device
Regex Explainer runs 100% locally. Everything you paste or drop is processed by your own browser and never transmitted. Nothing is stored on our servers — close the tab and it is gone.
Nothing you type is sent to a server, logged, or used for analytics. The page works even with your network disconnected after first load.