4 ms·
/@/ usually does the job for me... hehe
by arianvanp 12y ago
/@/ usually does the job for me... hehe
- allegory 12y agoI use a slightly more complex variation of that: ^.+@.+\..+$ Works wonders. I think when testing the addresses on a sign up form, we got only 0.5% that we couldn't relay too which was a pretty good hit rate.
- paulnechifor 12y agoIt looks to me like you're neglecting email addresses from <http://ai./> http://ai./>. The 'ai' TLD does have an MX record.
- allegory 12y agoYes; I get told that every time I mention it :-)
- tragomaskhalos 12y agoI would suspect that anyone whose email did not match that regex would have such a miserable time generally getting it rejected as invalid left right and centre that they would just cave in and get a simpler one that did.
- TezzellEnt 12y agoThat's pretty good. I learned from Rails Tutorial to use this one: /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i It's worked for me when I needed to use it.
- szatkus 12y agoUnfortunately many devs try to be smarter and my something+website_name@gmail.com is usually rejected as incorrect :/
- hackerboos 12y agoThis a pain because gmail allows you to append anything you want after the + and it will still reach your inbox. For example - If your email address is johnsmith@gmail.com you can have mail sent to johnsmith+stopspamming@gmail.com and it will go into your inbox. http://lifehacker.com/144397/instant-disposable-gmail-addresses http://lifehacker.com/144397/instant-disposable-gmail-addres...
- bowlofpetunias 12y agoIronically, after many years this is still being rejected as incorrect by the Google Apps admin dashboard for Groups...
- sigsergv 12y agoMy 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