Don't use regular expressions to "validate" email addresses (was: Ineed some help with a regexp please)

Bruno Desthuilliers onurb at xiludom.gro
Fri Sep 22 05:00:57 EDT 2006


bruce wrote:
> so ben...
> 
> if you were creating a web app with an email form... rather than try to
> check if the email is valid...

Ever bothered to read the relevant rfc ?

> you'd create something to allow anyone to
> potentially spam the hell out of a system...

I'm sorry, but I fail to see how validating (or not) an email address
could prevent using a webmail form for spamming. Care to elaborate ?

> my two cents worth... try to verify/validate that the email is valid, 

If it doesn't have an @ somewhere in it, it's not a valid mail address.
Else, it may or not be a valid email address - and then the only
reliable way to know is to send a mail to that address.

> and
> possibly belongs to the user...

How do you intend to check this ?

-- 
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in 'onurb at xiludom.gro'.split('@')])"



More information about the Python-list mailing list