regex fix: escape the first '-' too, add start/end of the string.
authorBarış Metin <Talip-Baris.Metin@sophia.inria.fr>
Mon, 14 Dec 2009 10:19:23 +0000 (10:19 +0000)
committerBarış Metin <Talip-Baris.Metin@sophia.inria.fr>
Mon, 14 Dec 2009 10:19:23 +0000 (10:19 +0000)
PLC/Persons.py

index bcfd565..1d3059f 100644 (file)
@@ -84,7 +84,7 @@ class Person(Row):
         if not email:
             raise invalid_email
 
-       email_re = re.compile('[a-zA-Z0-9._%+-]+@[a-zA-Z0-9._\-]+\.[a-zA-Z]+')
+       email_re = re.compile('\A[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9._\-]+\.[a-zA-Z]+\Z')
         if not email_re.match(email):
             raise invalid_email