Regex Tester
Test regular expressions against any string in real time — matches are highlighted instantly as you type, with all capture groups listed for each match. Uses JavaScript's native RegExp engine. Toggle g, i, m, and s flags with a single click. Safe for sensitive test data — everything runs locally.
How to Use the Regex Tester
- 1
Enter your pattern
Type your regular expression in the pattern field — without the surrounding slashes.
- 2
Toggle flags
Enable g (global), i (case-insensitive), m (multiline), or s (dotAll) flags as needed with a single click.
- 3
Enter your test string
Paste or type the text you want to match against in the test string area.
- 4
Review matches
Matches are highlighted in the test string in real time. All capture groups for each match are listed below.
Key Features
Live Highlighting
All matches highlighted in the test string as you type — no button press required.
Capture Groups
Every group from every match listed with its index, name (if named), and matched value.
Flag Toggles
g / i / m / s flags toggle with a single click for rapid pattern iteration.
Pro Tips
Use named capture groups (?<name>pattern) instead of numbered groups for cleaner extraction code — the name is shown alongside the match.
The g (global) flag is required to find all matches — without it, JavaScript stops after the first match.
Test your regex with edge cases: empty strings, strings with only special characters, and very long inputs to verify performance.
Privacy Note
All processing in this tool runs entirely in your browser — no data is transmitted to any server. Your input is never logged, stored, or shared. This tool is free to use with no account or registration required.
Frequently Asked Questions
Related Developer Tools
Your input is processed locally in your browser and is never stored, transmitted, or shared with any server. See our Privacy Policy.