Ticket #2307: regex.py
File regex.py, 325 bytes (added by , 18 years ago) |
---|
Line | |
---|---|
1 | """ |
2 | Regular expression for national telephone numbers. |
3 | """ |
4 | |
5 | import re |
6 | |
7 | # American phone number format xxx-xxx-xxxx |
8 | phone_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 |
11 | phone_pt_br = re.compile(r'^[0-9]{2}-[0-9]{4}-[0-9]{4}$', re.IGNORECASE) |