Regex Tester
Test regular expressions online with real-time match highlighting. Debug regex patterns against test strings with flag support and match details.
//g
Enter a regex pattern to see matches.
Results update in real-time
What does this tool do?
The Regex Tester lets you test JavaScript regular expression patterns against a test string in real-time. It shows all matches with their index positions and named capture group values.
How to use this tool
- Enter your regex pattern (without slashes)
- Select the desired flags (g, i, m)
- Enter your test string
- Matches appear instantly as you type
Supported flags
| Flag | Description |
|---|---|
g | Global — find all matches, not just the first |
i | Case insensitive — match regardless of letter case |
m | Multiline — ^ and $ match start/end of each line |
Common use cases
- Validating email, phone, or URL patterns
- Writing input validation rules for web forms
- Extracting data from structured text (logs, CSV, etc.)
- Testing search-and-replace patterns before applying them
- Learning and experimenting with regex syntax
- Debugging complex regex patterns with immediate feedback
Example
Pattern: \b\w+@\w+\.\w+\b
Flags: g
Test string: Contact us at hello@example.com or support@company.org
Matches: hello@example.com, support@company.org
Privacy
All processing happens in your browser. Nothing is transmitted.