Regex Tester
Test regular expressions with real-time match highlighting, replace mode, and common presets.
Common Regex Presets
Click any preset to load it into the pattern field.
How to Use the Regex Tester
Enter Your Pattern
Type your regular expression in the pattern box between the slashes. You can also click a preset below.
Set Flags
Use the checkboxes to set flags: g for all matches, i for case-insensitive, m for multiline, etc.
See Live Results
Matches highlight in real-time — yellow for odd matches, green for even. View detailed match list below.
Try Replace Mode
Switch to Replace Mode and enter a replacement string to see the substituted output. Use $1, $2 for capture groups.
Frequently Asked Questions
This uses JavaScript's built-in RegExp engine — the same flavour used in browsers and Node.js. It's compatible with most modern programming languages for common patterns.
g = find all matches (global), i = case-insensitive, m = multiline (^ and $ match line boundaries), s = dotAll (. matches newlines), u = full Unicode support.
Yes. Use parentheses () for capture groups. In Replace Mode, reference them with $1, $2, etc. Named groups (?<name>...) are also supported and can be referenced with $<name>.
Common reasons: missing g flag (only first match found), case sensitivity (try i flag), or special characters needing escaping. In this tool, type \d directly — no double-escaping needed.
No artificial limit — all matches in the test string are found and highlighted. Very large inputs may be slow due to browser rendering, but there is no hard cap.