Regex Tester
Test JavaScript regular expressions with live match highlighting, group inspection, and replace preview.
Common Patterns
Features
How to Use
1. Type your regex pattern in the top box.
2. Pick flags (g, i, m, s).
3. Type test text below — matches are highlighted live.
4. Switch to the Replace tab to preview replacements.
About this tool
Regular expressions are powerful and famously easy to get subtly wrong. This tester runs your pattern with JavaScript's own regex engine — the same one used in browsers and Node.js — and highlights every match in the test text as you type. The match details list each match with its position and the value of every capture group, and the replace panel previews substitutions using $1, $2 and other group references. Flags are one click away: g finds all matches, i ignores case, m makes ^ and $ work per line, and s lets the dot match line breaks. A short library of common patterns for email addresses, URLs, phone numbers, dates, hex colours and IPv4 addresses gives you a starting point to adapt.