Regex Explainer
NewPaste a regular expression and get a token-by-token, plain-English breakdown of what each part matches.
Frequently Asked Questions
How does the tool break the pattern into tokens?
It scans the pattern left to right, matching the longest known regex construct at each position — anchors, character classes, quantifiers, groups, escape sequences, and so on — falling back to treating a single character as a literal if nothing else matches.
Does it explain named and lookaround groups?
Yes — it distinguishes capturing groups, non-capturing groups ((?:...)), named capturing groups ((?<name>...)), and all four lookaround forms (positive/negative lookahead and lookbehind), each with a plain-English description of what it requires without consuming characters (for lookarounds).
What does it do with an invalid regex?
It tries to compile the pattern with JavaScript's RegExp constructor first; if that throws, it shows the actual JavaScript engine error message instead of attempting to explain malformed syntax.
Does it explain what the flags (like g, i, m) do?
Yes — any flags entered are translated to their plain-English names (global, case-insensitive, multiline, dotAll, unicode, sticky, hasIndices) and shown alongside the validity badge.
Can this test my regex against sample text?
Not this tool specifically — for live matching against sample text, use the Regex Tester tool. This one is focused purely on explaining the pattern's structure token by token.