.*@.*
/sEmail Regex that works 99.99%
21–30 of 65 posts
Re: Email Regex that works 99.99%
#22We built an app where sending a validation email upfront was not a practical option some time ago, and the best strategy I found for ensuring the email was valid was to lookup the MX records and ask the mailserver for the given domain, by issuing RCPT commands. Many mailservers will just drop connections when RCPT is for someone who doesn't exist or can't be routed to which was a good indicator of a typo or invalid address. And of course if the MX lookup fails the domain is incorrect.
Still wouldn't recommend this method either though really.
Re: Email Regex that works 99.99%
#23Utterly pointless. An email regex tells you that the email address (probably) conforms to a pattern that means it might be a valid email address (for now, until new weird TLDs emerge and the patterns have to change...), but it has no way of telling you whether that address can actually receive mail. `foo@bar` fails these regular expressions and `foo@bar.invalid` passes them, but neither will receive mail. As I have t…
foo@bar could still receive email, if you had a host in your DNS domain named bar, with a user named foo.
Re: Email Regex that works 99.99%
#24After extensive research, I have finally come up with a way to improve upon 99.99%. I have come up with a regex which will work for 100% of email addresses, and a significant number of regex engines, as an added bonus! Behold: .*@.* /s
.+@.+
Should do the trickRe: Email Regex that works 99.99%
#25Re: Email Regex that works 99.99%
#26So in 1 million emails, there are 10,000 valid emails that will be rejected. I guess if you use this regex then you'd better hope your service doesn't become popular.
Re: Email Regex that works 99.99%
#27So in 1 million emails, there are 10,000 valid emails that will be rejected. I guess if you use this regex then you'd better hope your service doesn't become popular.
Your math is off by a factor of 100.
Edit: Oh look, the submitter has pulled yet another figure out of thin air (author says "three nines, trust me," submitter says "four nines, omgwtfbetterthanslicedbread!!!1!"). Suspiciouser and suspiciouser.
Re: Email Regex that works 99.99%
#28Re: Email Regex that works 99.99%
#29After extensive research, I have finally come up with a way to improve upon 99.99%. I have come up with a regex which will work for 100% of email addresses, and a significant number of regex engines, as an added bonus! Behold: .*@.* /s
.+@.+ Should do the trick