Developer tool / 20
Regex Token Explainer & Pattern Analyzer
Deconstruct JavaScript regular expressions into plain-English token breakdowns for capture groups, character classes, and quantifiers.
Regex Token Explainer & Pattern Analyzer: TOEA parses regular expression patterns into individual AST tokens and generates plain-English descriptions for each component. Runs 100% locally in your browser with zero server file uploads.
- Category
- Developer tools
- Runs
- In your browser
- Cost
- Free · no sign-up
- Availability
- Ready to use
Runs entirely in your browser
Pattern Tokens Explanation
| Token | Category | Explanation |
|---|---|---|
/i | Regex Flags | Flags enabled: case-insensitive matching. |
^ | Anchor | Matches the start of the string or line. |
( | Group | Starts capturing group #1. |
[a-z0-9_\.-] | Character Class | Matches any single character inside character set [a-z0-9_\.-]. |
+ | Quantifier | Matches 1 or more of the preceding token (greedy). |
) | Group | Ends a capturing or non-capturing group. |
@ | Literal | Matches literal character '@'. |
( | Group | Starts capturing group #2. |
[\da-z\.-] | Character Class | Matches any single character inside character set [\da-z\.-]. |
+ | Quantifier | Matches 1 or more of the preceding token (greedy). |
) | Group | Ends a capturing or non-capturing group. |
\. | Character Class / Escape | Escaped character '.' |
( | Group | Starts capturing group #3. |
[a-z\.] | Character Class | Matches any single character inside character set [a-z\.]. |
{2,6} | Quantifier Range | Matches explicit range count {2,6}. |
) | Group | Ends a capturing or non-capturing group. |
$ | Anchor | Matches the end of the string or line. |
The many jobs of a question mark
A ? changes meaning with its position. After a character or group it makes it optional: colou?r. After another quantifier it makes that quantifier lazy, matching as little as possible: <.+?> stops at the first >, while <.+> runs to the last one in the line. At the start of a group it introduces special syntax: (?:…) groups without capturing, (?=…) and (?!…) look ahead, and (?<name>…) names a group. Read ? together with what comes just before it.
Shorthand classes are ASCII-only
In JavaScript, \d matches only 0–9, and \w only unaccented Latin letters, digits, and underscore. So \w+ finds caf in café, and \b treats the accented letter as a word boundary. For text in other languages, use a Unicode property class such as [\p{L}\p{N}_]+ with the u flag. Try the corrected pattern against real sample text in the regex tester.
Escaping in patterns and strings
Fourteen characters have special meaning and need a backslash to match literally: . * + ? ^ $ { } ( ) | [ ] \, plus / inside a /…/ literal. A pattern built from a string with new RegExp needs every backslash doubled, so \d+ becomes "\\d+". A pattern that works as a literal but not from a string has usually lost a backslash along the way.
How to use it
- Type or paste a JavaScript regular expression (e.g. /^[a-z0-9]+$/i).
- Click Explain Regex.
- Review the breakdown table explaining anchors, character classes, groups, and flags.
Privacy & limitations
Regex parsing and explanation happen entirely inside your browser.
Related tools
Frequently asked questions
Which regex features are explained?
Explains anchors (^, $), character classes (d, w, s, [a-z]), quantifiers (*, +, ?, {m,n}), capture groups, and flags.
Does it validate regex syntax?
Yes, syntax errors are caught and reported instantly.
Free tool · runs in your browser · no account required