Re:Show HN: Coding noob - first weekend project
by Sephr on Wednesday October 06, 2010 @12:45AM
(#1762753)
The email address validation is incorrect. Neither [email protected], [email protected]., test@io, test@io., test@::123, test@[::123], or test@[::123]:456 are accepted, and likely other cases. I suggest you take the easy route and just only check `emailAddress.indexOf("@") !== -1`.
[ Parent
| on HN ]
Re:Show HN: Coding noob - first weekend project
by giu on Wednesday October 06, 2010 @06:31AM
(#1763365)
Or have a look at the full RFC 2822 regular expression for matching
email addresses: http://code.iamcal.com/php/rfc822/full_regexp.txt
I'd personally stick with Sephr's advice, though ;-)
Re:Show HN: Coding noob - first weekend project
by merijnv on Wednesday October 06, 2010 @05:13AM
(#1763248)
This point should really be made more to web developers. Nothing annoys me like yet another website which tells me [email protected] is not a valid address and ruins my nice mail filtering...
Re:Show HN: Coding noob - first weekend project
by dfox on Wednesday October 06, 2010 @09:42AM
(#1763856)
There are SMTP addresses that are perfectly valid, non-local and yet does not contain '@'. But in practice that could be probably ignored.
But if you want to verify email address, then going with must contain '@' is probably one of the more reasonable routes (you should probably also ban few characters like newlines and ';').