Free Regex Tester & Debugger 2026
Test regular expressions against any string — see matches, capture groups, flags, and replacement results instantly. No signup, no install.
Regex Tester & Debugger
Enter pattern → paste test string → click Test Regex
Regex Syntax Cheatsheet
The most commonly used regular expression tokens with examples
| Token | Meaning | Example | Matches |
|---|---|---|---|
| . | Any character except newline | c.t | cat, cot, cut |
| \d | Any digit 0–9 | \d{4} | 2026, 1999 |
| \w | Word char [a-zA-Z0-9_] | \w+ | hello, user_1 |
| \s | Whitespace (space, tab, newline) | \s+ | Spaces between words |
| ^ | Start of string / line | ^Hello | Lines starting with Hello |
| $ | End of string / line | \d+$ | Numbers at end of line |
| * | Zero or more (greedy) | ab*c | ac, abc, abbc |
| + | One or more (greedy) | ab+c | abc, abbc (not ac) |
| ? | Zero or one (optional) | colou?r | color, colour |
| (…) | Capture group | (\d{4})-(\d{2}) | 2026-01, captures year+month |
| […] | Character class | [aeiou] | Any single vowel |
| | | Alternation (OR) | cat|dog | cat or dog |
Ready-to-Use Regex Patterns
Copy any pattern directly into the tester above
[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}https?:\/\/[^\s/$.?#].[^\s]*(\+1[-.\s]?)?\(?\d{3}\)?[-.\s]\d{3}[-.\s]\d{4}#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*])[A-Za-z\d@$!%*]{8,}(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)<[^>]*>Regex Flags Explained
How each flag changes your pattern's behaviour
iCase InsensitiveMakes the pattern match both uppercase and lowercase letters. hello matches Hello, HELLO, hElLo.
mMultilineMakes ^ and $ match the start and end of each line, not just the whole string.
sDot AllMakes . match newline characters too. Without this flag, . does not match
.
xVerboseAllows whitespace and comments inside the pattern. Use # for inline comments in complex patterns.
Frequently Asked Questions
Common questions about regular expressions and this tool