Regex Tester
Enter a regular expression and a test string to see matches highlighted in real time.
🔒100% Client-Side. Everything runs in your browser — no data is sent to any server.
Test string
Matches
Enter a pattern above to see matches
Python regex with the re module
import re
text = "Contact us at hello@example.com or support@site.org"
pattern = r'\b\w+@\w+\.\w+\b'
# Find all matches
matches = re.findall(pattern, text)
print(matches) # ['hello@example.com', 'support@site.org']
# Find with position info
for m in re.finditer(pattern, text):
print(f"Match: {m.group()!r} span: {m.span()}")
# Named groups
pattern2 = r'(?P<user>\w+)@(?P<domain>\w+\.\w+)'
m = re.search(pattern2, text)
if m:
print(m.group('user'), m.group('domain'))
Common regex patterns
| Name | Pattern |
|---|---|
\b[\w.+-]+@[\w-]+\.[a-z]{2,}\b | |
| URL | https?://[\w/:%#\$&\?~=\-\.]+ |
| IPv4 | \b(?:\d{1,3}\.){3}\d{1,3}\b |
| Date (YYYY-MM-DD) | \d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01]) |
| Python variable | [a-zA-Z_]\w* |
| Hex color | #(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})\b |