Regex Tester & Visualizer
Test, debug, and visualize regular expressions in real-time
Test String
Replace
Result:
Matches
No matches found
Capture Groups
No capture groups
Highlighted Matches
Regex Breakdown
Regex Cheat Sheet
Frequently Asked Questions
A regular expression (regex) is a sequence of characters that defines a search pattern. It's used for pattern matching with strings, or string matching, i.e. "find and replace"-like operations.
Regex flags modify how the pattern is matched: g (global match), i (case insensitive), m (multiline), s (dotAll, . matches newlines), u (unicode).
Capture groups are defined with parentheses (). You can reference them with $1, $2, etc. in replacement strings, or access them via the match array.
Greedy matching (*, +) tries to match as much as possible. Lazy matching (*?, +?) tries to match as little as possible by adding a ? quantifier.
Use our quick pattern "Email" to get started. A simple email regex is [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}.