Reed O'Brien <> added the comment:

Working toward a perfect email regex is pretty much a fool's errand. 

The colander RE would miss my name reed.o' :(  The 
formencode one would allow my apostrophe :) but alas both would also allow 
invalid emails: reed...obrien@, .re...@. Simultaneously both would disallow 
emails: "@ @"@, "shit this is valid?"@. So forth and so on. 

The whole mess of local atoms aside, the domain.... I am -1  on the proposal to 
use the formencode RE. There are currently 2 TLDs that are more than 4 
characters .travel and .museum. I have never seen anything from them. in fact I 
have never seen anything from a 4 letter TLD, but I will ignore that for now.

In reality the only way to validate an email is to try sending mail to it. I 
have in the 
past done domain validation via DNS lookup for an MX record. Alas, most mail 
systems will fall back to a record of last resort and deliver to an A record or 
a CNAME. That however is another mess.

The proposed domain RE modification would accept domains like It will, however, also allow invalid domains 
such as its.ironic and fuck.ICANN. I think this would allow far more invalid 
than blocking > 4 chars in the domain would reject invalid emails; for now.

Besides, you can provide your own validator if you have a special need (say an 
app that is local only) or it is an app for a .museum.

status: unread -> chatting

Repoze Bugs <>
Repoze-dev mailing list

Reply via email to