Title |
Test
Find
Phone number parser
|
Expression |
^(?:[\+]?[\(]?([\d]{1,3})[\s\-\.\)]+)?(?:[\(]?([\d]{1,3})[\s\-\/\)]+)([2-9][0-9\s\-\.]{6,}[0-9])(?:[\s\D]+([\d]{1,5}))?$ |
Description |
Parses most phone numbers into four groups: country code, area code, number, and extension. |
Matches |
011-656-555-1234 | (217)555-1234 | +82-10-5551-2345 | +(82) 10-5551-2345 | (907) 555-1234 | +886-2-55512345 | 1-416-555-1234 | 714 555 1234 | 714 555 1234 / 1234 | +886-2-55512345 x 1234 | +886-2-55512345x1234 | 1-416-555-1234 ext 1234 |
Non-Matches |
7735551234 | +11231234567 | 1(123)1234567 |
Author |
Rating:
Bill Ingram
|
Source |
http://bill-ingram.com/2011/11/04/phone-number-parse-regex/ |
Your Rating |
|