diff --git a/django/contrib/localflavor/us/forms.py b/django/contrib/localflavor/us/forms.py
a
|
b
|
|
13 | 13 | from django.utils.translation import ugettext_lazy as _ |
14 | 14 | |
15 | 15 | |
16 | | phone_digits_re = re.compile(r'^(?:1-?)?(\d{3})[-\.]?(\d{3})[-\.]?(\d{4})$') |
| 16 | phone_digits_re = re.compile(r'^(?:1-?)?(\d{3})[-/\.]?(\d{3})[-\.]?(\d{4})$') |
17 | 17 | ssn_re = re.compile(r"^(?P<area>\d{3})[-\ ]?(?P<group>\d{2})[-\ ]?(?P<serial>\d{4})$") |
18 | 18 | |
19 | 19 | class USZipCodeField(RegexField): |
… |
… |
|
34 | 34 | super(USPhoneNumberField, self).clean(value) |
35 | 35 | if value in EMPTY_VALUES: |
36 | 36 | return u'' |
37 | | value = re.sub('(\(|\)|\s+)', '', smart_unicode(value)) |
| 37 | value = re.sub('(\(|\)|/|\s+)', '', smart_unicode(value)) |
38 | 38 | m = phone_digits_re.search(value) |
39 | 39 | if m: |
40 | 40 | return u'%s-%s-%s' % (m.group(1), m.group(2), m.group(3)) |
diff --git a/tests/regressiontests/localflavor/us/tests.py b/tests/regressiontests/localflavor/us/tests.py
a
|
b
|
|
253 | 253 | '312.555.1212': '312-555-1212', |
254 | 254 | '312.555-1212': '312-555-1212', |
255 | 255 | ' (312) 555.1212 ': '312-555-1212', |
| 256 | '312/555.1212 ': '312-555-1212', |
| 257 | '312/555 1212 ': '312-555-1212', |
| 258 | '312/555-1212 ': '312-555-1212', |
256 | 259 | } |
257 | 260 | invalid = { |
258 | 261 | '555-1212': error_format, |