Regex Explainer
See a regex parsed into an AST tree with token-by-token descriptions.
Free & unlimited
Pattern
//
Pattern preview
^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,}$
AST
^AnchorStart of string (or line in multiline mode)[\w.-]+CharacterClassAny character in: \w.-, 1 or more (greedy)@LiteralLiteral character "@"[\w.-]+CharacterClassAny character in: \w.-, 1 or more (greedy)\.EscapeLiteral .[a-zA-Z]{2,}CharacterClassAny character in: a-zA-Z, 2 or more times$AnchorEnd of string (or line in multiline mode)Hover a node to highlight the matching portion of the pattern above.
All processing happens in your browser. No data is sent to any server.
About this tool
- 1
Enter a regex pattern
Paste or type any regular expression into the input field.
- 2
Read the explanation
Each part of the regex is broken down into plain English with color-coded segments.
- 3
Test with sample text
Enter test strings to see which parts match and which groups are captured.
- 4
Explore the visual diagram
View a railroad diagram showing the regex flow from start to end.
- Hover over any part of the regex to see its specific explanation highlighted.
- Capture groups are numbered and color-coded to show which part of the match they extract.
- Use the test panel to verify edge cases like empty strings, special characters, and Unicode.
- Click on explanation segments to jump to the corresponding part of the regex.
- Plain-language breakdown of every regex component
- Color-coded segments linking explanation to pattern parts
- Interactive railroad diagram visualization
- Live test panel with match highlighting and group extraction
- Supports JavaScript, Python, and PCRE regex flavors
- Understand a complex regex found in a codebase you inherited
- Debug why a regex is matching unexpected strings or missing valid ones
- Learn regex syntax by seeing plain English explanations of each token
- Document a regex by generating a human-readable description to add as a code comment
Yes. Positive and negative lookaheads (?=...) (?!...) and lookbehinds (?<=...) (?<!...) are fully explained.
Yes. Toggle between JavaScript, Python, and PCRE flavors since they have subtle differences in supported features.
A visual flowchart showing how the regex engine processes the pattern step by step, making complex patterns easier to understand at a glance.