Regex Tester
Test regular expressions with real-time matching and highlighting.
Pattern
Regular expression pattern
Test String
Enter text to test against the pattern
Result
Highlighted matches
Enter a test string to see matches
About the Regex Tester
Test regular expressions online with live match highlighting. Enter a pattern, paste sample text, and see matches, groups, and positions update as you type - a free, private regex debugger that runs entirely in your browser.
Regular expressions are powerful and notoriously tricky — an unescaped dot, greedy quantifier, or wrong anchor silently changes what your pattern matches. Testing against real input strings before deploying is the only reliable way to confirm a pattern does what you think.
This tester shows matches in real time as you type, with capture groups, match indices, and flag controls (global, case-insensitive, multiline). Pattern and input stay in your browser, safe for testing against production log samples or user data.
Use cases and examples
Build a validation pattern iteratively: try emails, phone numbers, or slugs against realistic samples until it matches exactly what you intend.
Understand a regex you found in code: paste it with sample input and watch which alternatives and groups fire.
Prepare a safe pattern for splitting or replacing text, verifying greedy versus lazy behavior before it hits production.
Pattern: /^(\+\d{1,3})?[\s-]?(\d{3})[\s-]?(\d{3})[\s-]?(\d{4})$/
Matches: +1 555-123-4567, 5551234567How to use
- Enter your regular expression in the pattern field.
- Choose the flags you need (g, i, m) or write them inline.
- Type or paste test strings — matches highlight as you type.
- Inspect capture groups to verify what each part of your pattern captures.
Frequently Asked Questions
What regex flavors are supported? ▾
The regex tester uses JavaScript regex engine supporting global, case-insensitive, multiline, and other standard flags.