Relax the RegEx restrictions to allow the new ICAAN TLDs.

This commit is contained in:
Jay Shirley
2014-08-08 09:11:05 -07:00
parent 174d964553
commit 85336f9777
3 changed files with 6 additions and 2 deletions

View File

@@ -160,8 +160,8 @@ class EmailField(StringField):
r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*"
# quoted-string
r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-011\013\014\016-\177])*"'
# domain
r')@(?:[A-Z0-9](?:[A-Z0-9-]{0,253}[A-Z0-9])?\.)+[A-Z]{2,6}$', re.IGNORECASE
# domain (max length of an ICAAN TLD is 22 characters)
r')@(?:[A-Z0-9](?:[A-Z0-9-]{0,253}[A-Z0-9])?\.)+[A-Z]{2,22}$', re.IGNORECASE
)
def validate(self, value):