Loading...
Loading...
Test Python regular expressions with live preview and explanations
[\w.-]+@[\w.-]+\.\w+Basic email validation
\d{3}-\d{3}-\d{4}Format: 555-123-4567
https?://[^\s/$.?#]\S*HTTP/HTTPS links
\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}IPv4 addresses
\d{4}-\d{2}-\d{2}Format: 2024-03-15
\d{2}:\d{2}(:\d{2})?Format: 14:30 or 14:30:00
#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})\bFormat: #FF5733 or #F00
^[a-zA-Z][a-zA-Z0-9_]{2,15}$Alphanumeric, 3-16 chars
\d{5}(-\d{4})?Format: 12345 or 12345-6789
<[^>]+>Matches HTML tags
\d{4}[- ]?\d{4}[- ]?\d{4}[- ]?\d{4}16 digits with optional separators
\d{3}-\d{2}-\d{4}Format: 123-45-6789
^(?=.*[A-Z])(?=.*[a-z])(?=.*\d).{8,}$Min 8 chars, 1 upper, 1 lower, 1 digit
^[a-z0-9]+(?:-[a-z0-9]+)*$Lowercase with hyphens for URLs
\$?\d{1,3}(,\d{3})*(\.\d{2})?Format: 1,234.56 or $1,234.56
([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}Full IPv6 addresses
re.findall() - Find ALL matches, return listre.search() - Find FIRST match anywherere.match() - Match at START of string onlyre.sub() - Replace all matches