Regex is great for finding and extracting patterns. It’s not great for fully validating complex standards (full RFC email/URL).
^[^\s@]+@[^\s@]+\.[^\s@]+$
https?:\/\/(?:www\.)?\S+
ISO timestamp:
\b\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?\b
Log level:
\b(INFO|WARN|WARNING|ERROR|DEBUG|TRACE|FATAL)\b
UUID:
\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\b
These patterns are designed for "looks like" checks, not full RFC compliance. For production validation, use dedicated libraries (email-validator, URL parser) that handle edge cases and international standards.
Full email validation requires checking DNS records, handling international domains, and validating against RFC 5322—far beyond regex capabilities. Use regex for quick checks, dedicated libraries for validation.
These patterns work with JavaScript, Python, Java, and most regex engines. Some may need minor adjustments for specific engines (PCRE, .NET).
Use our Regex Tester tool to test patterns against your text, see matches highlighted, and debug issues in real-time.
Use backslash: \. for literal dot, \+ for literal plus, \* for literal asterisk. In character classes [], most characters don't need escaping except ], ^, -, and \.