Regex validation of email addresses according to RFC5321/RFC5322
Nestable comments make the grammar for email-addresses irregular (context-free). If you preclude comments however, the resulting grammar is regular. The primary definition allows for (folding) whitespace between lexical tokens (e.g. a @ b.com). Removing all folding whitespace results in a canonical form. This is the regex for canonical email addresses according to RFC 5322 (precluding … Read more