I\'ve heard that it is a bad thing to validate email addresses with a regex, and that it actually can cause harm. Why is that? I thought it never could be a bad thing to val
Regex is not harmful.
Use a good email regex to filter the impatient fake user.
If you are selling to that individual, you might want to contact them
for further validation, though sellers don't care about email too much
and just validating the credit card is good enough for them.
Otherwise, the only other place where validation is necessary is when
someone wants access to and interact with your forum, and for some reason
you want get remuneration by selling their email to mass advertisers,
even though you say you won't do that.
A general email regex in the html5 spec is this -
^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$
http://www.w3.org/TR/html5/forms.html#valid-e-mail-address
^
[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+
@
[a-zA-Z0-9]
(?:
[a-zA-Z0-9-]{0,61}
[a-zA-Z0-9]
)?
(?:
\.
[a-zA-Z0-9]
(?:
[a-zA-Z0-9-]{0,61}
[a-zA-Z0-9]
)?
)*
$