Ticket #12027: email_re_patch.diff
File email_re_patch.diff, 1.0 KB (added by , 15 years ago) |
---|
-
django/forms/fields.py
421 421 email_re = re.compile( 422 422 r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*" # dot-atom 423 423 r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-011\013\014\016-\177])*"' # quoted-string 424 r')@(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+[A-Z]{2,6} \.?$', re.IGNORECASE) # domain424 r')@(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+[A-Z]{2,6}$', re.IGNORECASE) # domain 425 425 426 426 class EmailField(RegexField): 427 427 default_error_messages = { … … 532 532 533 533 url_re = re.compile( 534 534 r'^https?://' # http:// or https:// 535 r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+[A-Z]{2,6} \.?|' #domain...535 r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+[A-Z]{2,6}|' #domain... 536 536 r'localhost|' #localhost... 537 537 r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' # ...or ip 538 538 r'(?::\d+)?' # optional port