Regex Visualizer
Draw ECMAScript regex branches and capture groups, preview matches locally, and export a standalone SVG.
Enabling local controls…
Regular expression diagram
Build a diagram to see alternatives, quantifiers, and capture groups.
How to use this tool
Choose an example or enter your pattern and flags. Build the structure, or build and test it against your sample text. Copy or download the SVG.
When not to use it
The diagram shows literals and escapes, shorthand and bracketed character classes, alternation, groups, anchors, lookarounds, backreferences, and greedy or lazy quantifiers. Character classes and Unicode sets use one node each. Pattern limit 1,000 UTF-16 units, 20 levels, 200 diagram nodes and 20 captures. The local Worker allows one second of processing after startup. Testing accepts 16,000 text units and shows up to 50 matches. Pattern and text stay in this browser and do not appear in the URL.