Regex Debugger โ Token Breakdown ยท Smart Suggestions ยท AI Explain
Real-time ยท 26 features ยท AI explain ยท Unit tests ยท Diff mode ยท JS/Python/PHP ยท 100% browser
Debug regex patterns with token-by-token visual breakdown, smart suggestions for common mistakes (missing backslashes, greedy vs lazy, anchoring), inline error messages, and AI-powered plain English explanation.
What is a Regular Expression?
A regular expression (regex) is a sequence of characters that defines a search pattern. Used for validation, parsing, text manipulation, and data extraction in virtually every programming language โ JavaScript, Python, PHP, Java, and more.
How to Use This Regex Tester
Type your regex pattern in the input field. Matches highlight in real-time in the test text panel. Use the flags (g/i/m/s/u/y) to modify matching behavior. Switch between Test, Replace, Unit Test, Diff, and Multi-string modes using the tabs above.
Frequently Asked Questions
What are common regex mistakes?
Most common: (1) Forgetting backslash โ d+ instead of \d+. (2) Greedy matching โ .* matches too much, use .*? instead. (3) Missing anchors โ email regex matching "email@" inside longer strings. (4) Not escaping special chars โ using . when you mean \.
What does the AI explanation show?
The AI explanation breaks down each part of your regex into plain English, shows example strings that would match, and explains any flags. It uses the Anthropic Claude API โ falls back to a local explanation if offline.
What is the token visual?
The token visual breaks your regex into labeled blocks: literals, capture groups, character classes, quantifiers, anchors, and lookaheads. Each block is color-coded by type so you can see the pattern's structure at a glance.
Why does my regex work in one tool but not another?
Regex flavors differ between languages. JavaScript, Python (re), PHP (PCRE), and Java all have subtle differences in lookbehind support, flag syntax, and special character behavior. Use the flavor selector to switch and see warnings.