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.

Runs
In your browser
Cost
Free · no sign-up
Availability
Ready to use
Regex Token Explainer & Pattern AnalyzerLocal processing

Runs entirely in your browser

Pattern Tokens Explanation

TokenCategoryExplanation
/iRegex FlagsFlags enabled: case-insensitive matching.
^AnchorMatches the start of the string or line.
(GroupStarts capturing group #1.
[a-z0-9_\.-]Character ClassMatches any single character inside character set [a-z0-9_\.-].
+QuantifierMatches 1 or more of the preceding token (greedy).
)GroupEnds a capturing or non-capturing group.
@LiteralMatches literal character '@'.
(GroupStarts capturing group #2.
[\da-z\.-]Character ClassMatches any single character inside character set [\da-z\.-].
+QuantifierMatches 1 or more of the preceding token (greedy).
)GroupEnds a capturing or non-capturing group.
\.Character Class / EscapeEscaped character '.'
(GroupStarts capturing group #3.
[a-z\.]Character ClassMatches any single character inside character set [a-z\.].
{2,6}Quantifier RangeMatches explicit range count {2,6}.
)GroupEnds a capturing or non-capturing group.
$AnchorMatches 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

  1. Type or paste a JavaScript regular expression (e.g. /^[a-z0-9]+$/i).
  2. Click Explain Regex.
  3. 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