Regex Tester
Comprehensive regex testing suite with flags, live highlighting, capture groups, pattern library, and cheat sheet.
Regular Expression
Enter your regular expression pattern
Flags
Constructed regex:
/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)/g
Test Text
Highlighted Results
2 matches
You can contact me at test@example.com or my.other.email@domain.co.uk.
Phone: +1-555-123-4567
Date: 2024-01-15
URL: https://example.com
Match Details
| Group | Value | Copy |
|---|---|---|
| Full Match | test@example.com | |
| Group 1 | test@example.com |
| Group | Value | Copy |
|---|---|---|
| Full Match | my.other.email@domain.co.uk | |
| Group 1 | my.other.email@domain.co.uk |
Common Patterns
- [a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+
Email
- \+?1?-?\s?\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}
Phone (US)
- https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\....
URL
- \d{4}-\d{2}-\d{2}
Date (YYYY-MM-DD)
- (?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(...
IP Address
- #([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})
Hex Color
- (?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|3[47][0...
Credit Card
- <[^>]+>
HTML Tag
Regex Cheat Sheet
| . | Any character except newline |
| * | Zero or more of preceding |
| + | One or more of preceding |
| ? | Zero or one of preceding |
| ^ | Start of string |
| $ | End of string |
| [abc] | Any of a, b, or c |
| [^abc] | Not a, b, or c |
| [a-z] | Any lowercase letter |
| [A-Z] | Any uppercase letter |
| [0-9] | Any digit |
| \d | Any digit [0-9] |
| \w | Any word character [a-zA-Z0-9_] |
| \s | Any whitespace character |
| {3} | Exactly 3 times |
| {3,} | 3 or more times |
| {3,5} | Between 3 and 5 times |
| *? | Non-greedy zero or more |
| +? | Non-greedy one or more |
| (abc) | Capture group |
| (?:abc) | Non-capturing group |
| (?=abc) | Positive lookahead |
| (?!abc) | Negative lookahead |