From: Barış Metin Date: Mon, 14 Dec 2009 10:19:23 +0000 (+0000) Subject: regex fix: escape the first '-' too, add start/end of the string. X-Git-Tag: PLCAPI-4.3-31~3 X-Git-Url: http://git.onelab.eu/?p=plcapi.git;a=commitdiff_plain;h=398ece7fb2d64331c5396b82eea24fcd1c57c189 regex fix: escape the first '-' too, add start/end of the string. --- diff --git a/PLC/Persons.py b/PLC/Persons.py index bcfd565..1d3059f 100644 --- a/PLC/Persons.py +++ b/PLC/Persons.py @@ -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