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.
Example:
[\w.+-]+@[\w-]+\.[\w.]+ matches an email address.g all matches · i ignore case · m line anchors · s dot matches newlines · u unicode
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.