3 ms·
My regexp: [^@]+@[^@]+
by sigsergv 12y ago
My regexp: [^@]+@[^@]+
- mike-cardwell 12y agoThat fails on the perfectly valid email address: "Foo@bar"@example.com Although if that's your email address, you deserve everything you get ;) If you want to verify if an email address is valid, just ask your mail server if it is capable of sending mail to it: root@flan:~# /usr/sbin/sendmail -bv '"Foo@bar"@example.com' "Foo@bar"@example.com verified root@flan:~#
- dasil003 12y agoDoes it fail? I don't see ^ or $.
- mike-cardwell 12y agoI assumed it was anchored and he missed those off.
- ht_th 12y agoThe regexp looks for exactly one '@'-character preceded and followed by at least one character that's not an '@'-character. Or, in other words, it does not allow for an email address with more than one '@'-character.
- rplnt 12y agoThe point of the post was that since the regexp doesn't include start or end of a string it would still succeed: "Foo@bar"@example.com -> "Foo@bar"
- sigsergv 12y agoI don't need those “perfectly valid” email addresses. Person who create such addresses potentially dangerous.
- deleted 12y ago[deleted]