Test and debug regular expressions online with real-time match highlighting, group extraction, substitution preview, and a visual breakdown of your pattern. Supports all JavaScript regex features including lookaheads and named groups.
How to Use Regex Tester
- 1Type or paste a regular expression in the "Pattern" field (without delimiters)
- 2Select the flags (g, i, m, s, u) for global, case-insensitive, multiline, dotall, or unicode
- 3Enter test text — all matches highlight instantly in the text
- 4Switch to "Replace" mode to test search-and-replace using $1, $2 for captured groups
- 5View the visual explanation panel to understand what each part of your regex does
Features
- Real-time match highlighting with match details (position, captured groups) as you type
- Replace mode with live preview of search-and-replace results
- Visual regex explanation that breaks down your pattern into readable components
- Common pattern presets: email, URL, phone, date, IP address, credit card, and more
- Pattern cheat sheet with quick reference for common regex syntax and flags (g, i, m, s, u)
- Copy regex pattern and copy all matches with one click
- Runs entirely in your browser — no data sent to any server
Frequently Asked Questions
Do I include the delimiters in the pattern?
No. Type only the pattern itself without delimiters. For example, type "\d+" not "/\d+/". Delimiters are added automatically when copying.
What do the flags mean?
g = global (find all matches, not just the first), i = case-insensitive, m = multiline (^ and $ match line boundaries), s = dotall (. matches newlines), u = unicode (treat pattern as unicode).
What is a capturing group?
A capturing group is a part of the pattern wrapped in parentheses (...). It captures the matched text for that part separately. Named groups use (?<name>...) syntax.
Can I test regex replacement?
Yes. Toggle to "Replace" mode, enter a replacement string using $1, $2 etc. for captured groups, and see the result instantly.
Are my patterns saved or sent anywhere?
No. Everything runs locally in your browser using JavaScript's RegExp engine. Your patterns and test data never leave your device.
What regex syntax is supported?
The tool uses JavaScript's built-in RegExp engine, which supports most common regex features including lookaheads, lookbehinds, named groups, and Unicode property escapes.