Author: adrian
Date: 2006-05-31 13:08:28 -0500 (Wed, 31 May 2006)
New Revision: 3026

Modified:
   django/trunk/django/core/validators.py
Log:
Fixed #2049 -- Made isValidEmail validator wider in scope. Thanks, [EMAIL 
PROTECTED]

Modified: django/trunk/django/core/validators.py
===================================================================
--- django/trunk/django/core/validators.py      2006-05-31 16:13:08 UTC (rev 
3025)
+++ django/trunk/django/core/validators.py      2006-05-31 18:08:28 UTC (rev 
3026)
@@ -20,7 +20,10 @@
 ansi_date_re = re.compile('^%s$' % _datere)
 ansi_time_re = re.compile('^%s$' % _timere)
 ansi_datetime_re = re.compile('^%s %s$' % (_datere, _timere))
-email_re = 
re.compile(r'^[A-Z0-9._%-][+A-Z0-9._%-]*@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}$', 
re.IGNORECASE)
+email_re = re.compile(
+    r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*"  # 
dot-atom
+    
r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[\001-011\013\014\016-\177])*"'
 # quoted-string
+    r')@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}$', re.IGNORECASE)  # domain
 integer_re = re.compile(r'^-?\d+$')
 ip4_re = 
re.compile(r'^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$')
 phone_re = re.compile(r'^[A-PR-Y0-9]{3}-[A-PR-Y0-9]{3}-[A-PR-Y0-9]{4}$', 
re.IGNORECASE)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates
-~----------~----~----~----~------~----~------~--~---

Reply via email to