Regex Tester
DEVTest regular expressions live with match highlighting. Supports all JavaScript regex flags.
📖 How to Use Regex Tester
1
Enter your regex pattern
Type your regular expression in the pattern field (without forward-slash delimiters).
2
Set flags
Toggle flags: g (global — find all matches), i (case-insensitive), m (multi-line), s (dotAll).
3
Enter test string
Type or paste the text you want to match against.
4
See matches highlighted
All matches are highlighted in the test string, with match groups listed below.
💡 Examples
Email extraction
INPUT
Pattern: \b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b (flag: i)→
OUTPUT
Matches all valid email addresses in the textDate validation
INPUT
Pattern: ^\d{4}-\d{2}-\d{2}$→
OUTPUT
Matches dates in YYYY-MM-DD formatURL matching
INPUT
Pattern: https?://[^\s]+→
OUTPUT
Matches http:// and https:// URLs🚀 Pro Tips
✓Use `\b` word boundaries to match whole words only and avoid partial matches.
✓`.+` matches one or more of any character (except newline). Use `.*` for zero or more.
✓Use non-capturing groups `(?:...)` when you group without wanting capture group references.
✓Test with edge cases: empty string, very long string, Unicode characters, and newlines.
✓The `?` after a quantifier makes it non-greedy: `.*?` matches as few characters as possible.