Skip to content

Commit

Permalink
Syntax change.
Browse files Browse the repository at this point in the history
  • Loading branch information
g1smd committed Sep 17, 2012
1 parent 5fc8283 commit 6902292
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions django/contrib/localflavor/gb/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def clean(self, value):

number_parts = {'prefix': '+44 ', 'NSN': '', 'extension': None}

gb_number_parts = re.compile(r'
gb_number_parts = re.compile(r"""
^\(?
(?: # leading 00, 011 or + before 44 with optional (0);
# parentheses, hyphens and spaces optional
Expand All @@ -128,9 +128,9 @@ def clean(self, value):
(?:
((?:x|ext\.?|\#)\d+)? # optional extension number
)
$', re.X)
$""", re.X)

valid_gb_pattern = re.compile(r'
valid_gb_pattern = re.compile(r"""
^\(?
(?: # leading 00, 011 or + before 44 with optional (0)
# parentheses, hyphens and spaces optional
Expand All @@ -152,7 +152,7 @@ def clean(self, value):
(?:
(?:[\s-]?(?:x|ext\.?|\#)\d+)? # optional extension number
)
$', re.X)
$""", re.X)

# Check if number entered matches a valid format
if not re.search(valid_gb_pattern, value):
Expand Down

0 comments on commit 6902292

Please sign in to comment.