Ticket #2307: regex.py

File regex.py, 325 bytes (added by Wiliam Alves de Souza <wiliamsouza83@…>, 17 years ago)

Regular expression for national telephone numbers. Put it in .../django/core/

Line 
1"""
2Regular expression for national telephone numbers.
3"""
4
5import re
6
7# American phone number format xxx-xxx-xxxx
8phone_en_us = re.compile(r'^[A-PR-Y0-9]{3}-[A-PR-Y0-9]{3}-[A-PR-Y0-9]{4}$', re.IGNORECASE)
9
10# Brazilian phone number format xx-xxxx-xxxx
11phone_pt_br = re.compile(r'^[0-9]{2}-[0-9]{4}-[0-9]{4}$', re.IGNORECASE)
Back to Top