Regex Tester
Test regular expressions live with highlighting, capture groups, and replace preview. Free and fully client-side.
2 matches
Contact [email protected] or [email protected] for details.
Matches (2)
[email protected][email protected]Common Patterns
Click to load a pattern (loads a sample string if yours is empty).
Quick Answer
Paste a test string, type a pattern, and see every match highlighted live. Toggle flags (g, i, m, s, u), inspect capture groups per match, and preview search-and-replace results before using the expression in code. The tester validates your pattern as you type and explains syntax errors instead of crashing. It runs entirely in your browser — free, with no signup and nothing stored.
How It Works
Enter your regular expression in the pattern field
Toggle the flags your expression needs (g, i, m, s, u)
Paste or type the test string
Review highlighted matches and capture groups, or switch to replace mode to preview substitutions
Key Facts
- Live match highlighting as you type
- Flags: g (global), i (ignore case), m (multiline), s (dotAll), u (unicode)
- Match list shows index, full match, and capture groups (numbered and named)
- Replace mode previews search-and-replace output
- Invalid patterns show a clear error state instead of failing silently
- Runs 100% client-side — nothing you paste leaves your browser
Frequently Asked Questions
What does the g flag do?
The g (global) flag makes the expression match every occurrence in the string instead of stopping at the first match. Without it, methods like match() and replace() only touch the first match.
How do capture groups work?
Parentheses create capture groups: (\d{4})-(\d{2})-(\d{2}) captures a year, month, and day separately. The tester lists each group per match; named groups like (?<year>\d{4}) appear with their names.
Is my data sent to a server?
No. All matching, highlighting, and replace previews run locally in your browser. Nothing you type is uploaded, logged, or stored.
Why does my valid regex show an error?
The tester uses the JavaScript (ECMAScript) regex engine. Lookbehind, possessive quantifiers from PCRE, or flags from other languages (like x for extended mode) are not supported and will raise a syntax error here.