Regex Tester - Test Regular Expressions
Test and debug regular expressions with real-time matching and replacement. Our Regex Tester shows matches instantly and supports common regex patterns.
Features
- Real-time matching - See matches as you type
- Flag support - Global, case-insensitive, multiline
- Replacement testing - Test regex replace operations
- Match highlighting - View all matches
- Common patterns - Quick-load email, phone, URL patterns
- Quick reference - Regex syntax cheat sheet
Regex Flags
| Flag | Meaning |
|---|---|
| g | Global - find all matches |
| i | Case-insensitive |
| m | Multiline mode |
| s | Dot matches newlines |
Common Patterns
| Pattern | Use Case |
|---|---|
[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,} | |
| Phone | \d{3}[-.]?\d{3}[-.]?\d{4} |
| URL | https?://[\w.-]+(?:/[\w.-]*)* |
| IP Address | \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} |
| Date | \d{4}-\d{2}-\d{2} |
How to Use
- Enter your regex pattern
- Select flags (g, i, m, s)
- Enter test text
- View matches highlighted
- Optionally enter replacement text
- See replacement result
Quick Reference
| Syntax | Meaning |
|---|---|
. | Any character |
\d | Digit (0-9) |
\w | Word character |
\s | Whitespace |
* | 0 or more |
+ | 1 or more |
? | 0 or 1 |
^ | Start of line |
$ | End of line |
FAQs
Is my data secure?
Yes! All processing happens in your browser.
What regex flavor is this?
JavaScript regex (ECMAScript).
Can I test lookahead/lookbehind?
Yes, JavaScript supports (?=), (?!), (?<=), (?<!).
Use Cases
- Pattern development - Build and test regex
- Data validation - Validate email, phone, etc.
- Text extraction - Extract specific patterns
- Learning - Understand regex behavior