Regex for Email Validation — Test Email Patterns
Quick Answer: A practical email regex is: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$. This covers most real-world emails. Note: the full RFC 5322 email spec is nearly impossible to capture in regex -- for production, validate format loosely and confirm via verification email.
FAQ
What is the best regex for email validation?
For most apps: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/. It rejects obvious invalid input without being overly strict on unusual but valid addresses.
Should I use regex for email validation in production?
Use regex for basic format checking only. The only true validation is sending a confirmation email. Some valid addresses (like user+tag@domain or IDN domains) may fail strict regex.