Mastering Regular Expressions 2nd Ed.

Andrae Muys amuys at shortech.com.au
Wed Jul 24 01:10:20 EDT 2002


Paul Rubin <phr-n2002b at NOSPAMnightsong.com> wrote in message news:<7xn0si9o2o.fsf at ruckus.brouhaha.com>...
> Tim Roberts <timr at probo.com> writes:
> > The multi-thousand byte full expression to match a valid RFC822 e-mail
> > address was practically worth the price all by itself!
> 
> Argggh!  That sounds like regular expressions aren't really the best
> way to match RFC822 addresses.

More like matching RFC822 addresses isn't worth the price of
admission.  Still you missed the point, 822 addresses are complex
beasts, not all valid emails are of the form \S+@\w(\.\w)*.  The point
of the RFC822 regex is that, assuming the address points to a valid MX
record, the only practical way to test if an email address is valid is
to try sending email to it.

Andrae Muys



More information about the Python-list mailing list