What it does
Read a regex as a tree: groups, quantifiers, classes and assertions, each linked to its place in the source.
How to use it
- Type the regex; no test text is needed.
- Move through the tree with the arrow keys; Enter selects that part of the pattern.
- Export the tree as SVG or JSON.
Verified example
Example
Text "AB-007"
([A-Z]{2})-(\d{3}) Result: "AB-007"; groups "AB", "007"
([A-Z]{2})-(\d{3}) Result: "AB-007"; groups "AB", "007"
([A-Z]{2})-(\d{3}) Result: "AB-007"; groups "AB", "007"
([A-Z]{2})-(\d{3}) Result: "AB-007"; groups "AB", "007"
Counterexample
Text "A-7"
([A-Z]{2})-(\d{3}) Result: no match
([A-Z]{2})-(\d{3}) Result: no match
([A-Z]{2})-(\d{3}) Result: no match
([A-Z]{2})-(\d{3}) Result: no match
Recorded by running fixture FX-S04 on : rp.js@1 on Node v24.21.0 (V8), v24.21.0, CPython 3.14.2 (Pyodide 314.0.7), PCRE2 10.48, go1.27.1. JavaScript results come from the rp.js@1 core on Node’s V8; your browser runs the same core.
Engines
- JavaScript patterns use a full ECMAScript parser; Python, PCRE2 and Go use a core grammar, and constructs outside it are marked as not explained.
Limits
- The tree shows how the pattern is read, not what it matches; run it to see matches.