Regex Visual Explainer
Paste a regular expression and this tool breaks it into tokens, explains each token in plain English, highlights every match in your test text, and warns you about common regex mistakes.
[\w.+-]+@[\w-]+\.[\w.]+ matches an email address.Token map
Each colored block is one token of your pattern, in order.
| Token | Type | What it means |
|---|
Matches in your test text 0
Warnings and tips
How to use
- Type or paste a regular expression in the first box, without the surrounding slashes.
- Add your test text and choose flags, then press Explain Pattern.
- Read the token map to learn what each part of the pattern does.
- Check the highlighted matches and the warnings before using the pattern in your own code.
Good to know
- A dot
.matches any character, so write\.when you mean a real dot. .*is greedy and matches as much as possible;.*?is lazy and matches as little as possible.- Round brackets
( )remember what they match;(?: )groups without remembering.
Frequently Asked Questions (FAQ)
What does the Regex Visual Explainer do?
It breaks your regular expression into tokens, explains each token in plain English, highlights every match in your test text, and shows warnings for common regex mistakes.
How do I analyze a pattern with this tool?
Type or paste the pattern without the surrounding slashes, add your test text and choose flags, then press Explain Pattern to see the token map and the highlighted matches.
What is the difference between greedy and lazy matching?
.* is greedy and matches as much as possible, while .*? is lazy and matches as little as possible. The Greedy vs lazy demo button on the page shows this in action.
Why should I write backslash-dot instead of a plain dot for a real dot?
A plain dot matches any character. The Good to know notes on the page say to write backslash-dot when you mean a real dot in your pattern.