Regex Tester
Test regular expressions against a string with real-time match highlighting. Supports g, i, m, s flags, capture groups, and replacement strings with group references.
100% client-side · no data leaves your browser
Replace
How to test a regular expression
Write and validate a regex against sample input with live match highlighting.
- 1
Enter the pattern
Type your regex (without the surrounding slashes) into the pattern field.
- 2
Set the flags
Toggle g, i, m, s, u, y flags as needed for your use case.
- 3
Add test input
Paste sample text below. Matches are highlighted and capture groups are listed.
- 4
Optional: try a replacement
Enter a replacement string (with $1, $2 references) to preview the result.