New submission from cd34 <>:

line 249, colander/

        super(Email, self).__init__(
            u'(?i)^[a-z0-9._%+...@[a-z0-9.-]+\.[a-z]{2,4}$', msg=msg)

the regexp has a number of issues.  First, tlds can be longer than 4 
i.e. .museum.

FormEncode splits on the @ and validates the username and domain portion 
separately and does properly do the domain handling, but, the username portion 
still has issues.  A quick fix would be to append the DomainRE from FormEncode 
with the existing userside regexp from the current code.

FormEncode's regexp from formencode/

    usernameRE = re.compile(r"^[^ \t\n\r@<>()]+$", re.I)
    domainRE = re.compile(r'''
        ^(?:[a-z0-9][a-z0-9\-]{0,62}\.)+ # (sub)domain - alpha followed by 
chars (63 total)
        [a-z]{2,}$                       # TLD
    ''', re.I | re.VERBOSE)

(I couldn't find a place to report bugs for deform/colander in the topics.  As 
project didn't seem to match any existing repoze.*, I'm hoping it is a catchall)

messages: 465
nosy: cd34
priority: bug
status: unread
title: Colander Email Regexp breaks in a few cases
topic: repoze.project

Repoze Bugs <>
Repoze-dev mailing list

Reply via email to