On Fri, Oct 20, 2006 at 10:03:03PM +0100, Martin Aspeli wrote: > > >The complete regex would look like this: > > > >re.compile(r'^([\w!#$%&\'*+\-/=?^`{|}~]+(\.[\w!#$%&\'*+\-/=?^`{|}~]+)*' > > r'|"[^(\|")]*")@[\w-]+(\.[\w-]+)+$') > > > That is possibly the ugliest sequence of characters I have ever seen.
Heh. There are lots of regexes floating around that attempt to solve email. For example http://regexlib.com/DisplayPatterns.aspx?cattabindex=0&categoryId=1 If I were doing it from scratch I'd break it into manageable chunks and use simpler regexes on the fragments. Split on '@' for a start. Trying to do something as non-regular as email addresses with one regular expression just hurts my head too much. -- Paul Winkler http://www.slinkp.com _______________________________________________ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests