After 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
Email Regex that works 99.99%
51–60 of 65 posts
Re: Email Regex that works 99.99%
#52After 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
$ nc localhost 25 220 uhura.z ESMTP MAIL FROM:me 250 2.1.0 Ok RCPT TO:root 250 2.1.5 Ok DATA 354 End data with . Look ma, no @! . 250 2.0.0 Ok: queued as 8DB653E0065 quit 221 2.0.0 Bye
.* it is!
Re: Email Regex that works 99.99%
#53After 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
What regex would you suggest to match all e-mail addresses contained within an arbitrary body of text (as opposed to a single text field where you don't have worry about other text strings)?
Of course, if you're really trying to scrape email addresses reliably, looking for the '@' won't work reliably, since people are used to obfuscating their email with [at] or (at) to protect against spam (well, more spam). You will probably need to dive into AI theory to more reliably get email addresses.
Re: Email Regex that works 99.99%
#54I find it strange that there's no information on the author, sources, references, attribution, or credits on the page at all (other than the WordPress theme attribution).
Re: Email Regex that works 99.99%
#55I implemented this in Ruby a while back, but I also went the next step and added a DNS check for a MX record. That way you can ensure there's a mail server to receive an email. Heck, I even wrote a blog post about it.
http://stevenkaras.github.io/blog/verifying-email-addresses
We've had pretty good feedback so far, but I've also spotted a few emails that people enter that are clearly fake (e.g. asdf at test.com).
Re: Email Regex that works 99.99%
#56Alternatively, don't validate email addresses with a regex because it's pointless. Check that at least an '@' symbol is present and just send a damn email already[0]. Or better, don't send a damn email at all and let them access it because it's pointless to have an extra verification step. If you really want to do some clientside validation, just keep a basic regex and warn the user if the address doesn't seem right.…
If you validate emails as complying to the email format used by those services, you can reduce your hard bounces to a bare minimum. If you check for a valid mail server at that domain, you can reduce that to 0. If you connect to their server and check for an error for that mailbox, you can reduce your soft bounces to 0 too, but that requires a lot of legwork to set up.
Re: Email Regex that works 99.99%
#57How come the .NET version is so small compared to the others?
Re: Email Regex that works 99.99%
#58Alternatively, don't validate email addresses with a regex because it's pointless. Check that at least an '@' symbol is present and just send a damn email already[0]. Or better, don't send a damn email at all and let them access it because it's pointless to have an extra verification step. If you really want to do some clientside validation, just keep a basic regex and warn the user if the address doesn't seem right.…
Pointless? Methinks you've never worked with Mandrill or another service that penalizes you for hard/soft bounces. If you validate emails as complying to the email format used by those services, you can reduce your hard bounces to a bare minimum. If you check for a valid mail server at that domain, you can reduce that to 0. If you connect to their server and check for an error for that mailbox, you can reduce your so…
Re: Email Regex that works 99.99%
#59Earlier quoted context omitted.
Pointless? Methinks you've never worked with Mandrill or another service that penalizes you for hard/soft bounces. If you validate emails as complying to the email format used by those services, you can reduce your hard bounces to a bare minimum. If you check for a valid mail server at that domain, you can reduce that to 0. If you connect to their server and check for an error for that mailbox, you can reduce your so…
If you're willing to work with a service that you're paying for AND that penalizes you for erroneous bounces, that's kind of your problem.