3 ms·
I would think you'd use: /.+@.+\..+/
by aroch 10y ago
I would think you'd use: /.+@.+\..+/
- pmlnr 10y agonope. root@localhost is a valid mail address.
- aroch 10y agoHow often are you validating email addresses for localhost!? Those are pretty much never a valid email for >>>99% of applications
- mason55 10y agoRight, so if you're not going to accept the full RFC then where do you draw the line? Your arbitrary line will assuredly be different from someone else's.
- nothrabannosir 10y agoThat's the whole point of the original post: don't bother thinking about it, let the mta do that for you. The "@" is a courtesy to make sure people didn't mistakenly put their name in. Don't validate, just do a sanity check.
- strictnein 10y agoAnd people are just as likely to type an valid but incorrect email address as a invalid email address.
- nkrisc 10y agoThat's why you also implement an email verification method if you actually care that it's a correct email as well as valid.
- deleted 10y ago[deleted]