The 'spec' for validating an email address is to send mail containing a token to it and require the user to respond with it.
Bang paths are valid but aren't going to be routable these days. Different hosts allow different characters in usernames, and have different meta-replacement rules for stuff like periods and pluses.
You don't validate a domain name with a regex, you use a goddamn DNS resolver. Email addresses are a superset of that! Don't use a fucking regex.
Bang paths are valid but aren't going to be routable these days. Different hosts allow different characters in usernames, and have different meta-replacement rules for stuff like periods and pluses.
You don't validate a domain name with a regex, you use a goddamn DNS resolver. Email addresses are a superset of that! Don't use a fucking regex.