Test, validate and match regular expressions
Validates email addresses with length limits inspired by RFC 5321/5322: a local part of 1-64 allowed characters (alphanumerics plus email-safe specials), followed by @, then up to 255 domain segments of alphanumerics/hyphens, capped at an overall 320-character bound. Typically used for form and input email validation in JavaScript. Note the unescaped dot in the domain matches any character, a common subtle bug.