a more precise re for email addys

André Malo auch-ich-m at g-kein-spam.com
Wed Jan 18 15:37:23 EST 2006


* rbt wrote:

> Is it possible to write an re that _only_ matches email addresses?

No. The only way to check if the matched thing is a mail address is to send
a mail and ask the supposed receiver whether he got it.

The grammar in RFC 2822 nearly matches anything with an @ in it. So, how
accurate your regex needs to be depends heavily on the context of the
usage. For example, my suggestion for web form checkers is always to just
look for an @ char and do the rest using the human component.

nd
-- 
Already I've seen people (really!) write web URLs in the form:
http:\\some.site.somewhere
[...] How soon until greengrocers start writing "apples $1\pound"
or something?                           -- Joona I Palaste in clc



More information about the Python-list mailing list