Regex Tester / Editor / Match Visualizer
Test, visualize, replace, and explain regular expressions. Everything runs in your browser
| # | Match | Start | End | Length | Groups |
|---|
$1 $2 capture groups · $& full match · $` before match · $' after match · $$ literal $ · $<name> named groupClick any example to load it into the Test tab and run it automatically.
Tips
Auto Run for Instant Feedback
With Auto Run enabled, results update as you type. The tool debounces input to keep the UI responsive. For very large texts, Auto Run is automatically disabled to prevent freezing.
Understanding Capture Groups
Parentheses () create capture groups. Click any match in the table to see its groups. Named groups (?<name>...) make regex more readable and replacement easier with $<name>.
Avoiding Catastrophic Backtracking
Nested quantifiers like (a+)+ or (a|a)*b can cause exponential execution time. Keep patterns simple, use atomic constructs when possible, and test with edge-case inputs.
JavaScript Engine Differences
This tool uses JavaScript RegExp. Some features like possessive quantifiers and atomic groups are not available. Lookbehind requires a modern browser. Python, PCRE, and .NET regex may behave differently.
Common Use Cases
Form Validation
Test email, phone, date, and password patterns before implementing them in your frontend or backend validation logic.
Log Analysis
Extract timestamps, error levels, and messages from log files using named capture groups. Copy matches as JSON for further processing.
Data Extraction
Pull URLs, IP addresses, UUIDs, or hex colors from unstructured text. The match table shows every occurrence with position details.
Code Refactoring
Use the Replace tab to test find-and-replace patterns before applying them in your IDE. Supports capture group references like $1 and $<name>.
Learning Regex
The Explain tab breaks down any pattern into plain-English tokens. Combined with the Cheat Sheet and Examples, it is a complete learning environment.