Displaying page
of
pages;
Items to
Title |
Test
Details
Pattern Title
|
Expression |
^(?:(?<Contry>\d{1,1})(?<5>[- ]?)?)?(?:(?<1>[(])?(?<AreaCode>[2-9]\d{2})(?(1)[)])(?(1)(?<2>[ ])|(?:(?<3>[-])|(?<4>[ ])))?)?(?<Prefix>[1-9]\d{2})(?(AreaCode)(?:(?(1)(?(2)[- ]|[-]?))|(?(3)[-])|(?(4)[- ]))|[- ]?)(?<Suffix>\d{4})(?:[ ]?[#xXeE]?(?<Ext>\d{2,4}))?$
|
Description |
Regular expression for validating US and CANADA telephone numbers with OPTIONAL contry code, OPTIONAL area code, and OPTIONAL extension. Matches various permutations of formatting characters (parenthesis, space, dash). Parses the telephone number contry code, area code, prefix, suffix, and extension ...
|
Matches |
1-(222) 333-4444 | 1 (222) 333-4444 | 12223334444
|
Non-Matches |
1- (222) 333 4444 | 1 (222) 333-4444 | 1 2223334444
|
Author |
Rating:
Marc Robitaille
|
Displaying page
of
pages;
Items to