Core principles Covers ~99% of practical use cases Returns exactly 2 capturing groups (username and domain) Balances between RFC 5322 compliance and practicality
✅ Accepts: Basic email addresses Special characters: `! # $ % & ' * + / = ? ^ \ { | } ~ `` Dots, hyphens, underscores in username Hyphens and underscores in domain Multi-level domains (e.g., .co.uk) Username starting with _ or - Username ending with special characters (e.g., +)
❌ Rejects: Username starting/ending with a dot Double dots in username or domain Missing TLD Domain starting/ending with a hyphen Spaces, quotes, parentheses Multiple @ signs IP addresses in square brackets