Return to Snippet

Revision: 5527
at March 13, 2008 15:10 by martinkas


Updated Code
^((1|+1)?( |-|.)?)?((?[0-9]{3})?|[0-9]{3})( |-|.)?([a-zA-Z0-9]{3}( |-|.)?[a-zA-Z0-9]{4})[ ]*(( |x|ext|ext.|extension|Ext|Ext.|Extension|#){1}[ ]?([0-9]){1,7}){0,1}$

matched
(223)456 7891 x 123
(223)456 7891 ext 123
(223)456 7891 ext. 123
(223)456 7891 Ext 123
(223)456 7891 Ext. 123
(910)456-8970 x12
(910)456-8970 #12
(910)456-8970 extension12456
(910)456-8970 Extension 12456
234.445.6789
987 765-8765
1 (453) 876 9876
+1 (453) 876 9876
(800)ABCDEFG
(800) ABC-1234

not matched
2 (453) 876 9876
(4534) 876 9876
(453) 8764 9876
(453) 876 98769

Revision: 5526
at March 13, 2008 15:07 by martinkas


Initial Code
^((1|+1)?( |-|.)?)?((?[0-9]{3})?|[0-9]{3})( |-|.)?([a-zA-Z0-9]{3}( |-|.)?[a-zA-Z0-9]{4})[ ]*(( |x|ext|ext.|extension|Ext|Ext.|Extension|#){1}[ ]?([0-9]){1,7}){0,1}$

matched
(223)456 7891 x 123
(223)456 7891 ext 123
(223)456 7891 ext. 123
(223)456 7891 Ext 123
(223)456 7891 Ext. 123
(910)456-8970 x12
(910)456-8970 #12
(910)456-8970 extension12456
(910)456-8970 Extension 12456
234.445.6789
987 765-8765
1 (453) 876 9876
+1 (453) 876 9876
(800)ABCDEFG
(800) ABC-1234

not matched
2 (453) 876 9876
(4534) 876 9876
(453) 8764 9876
(453) 876 98769

Initial URL

                                

Initial Description

                                

Initial Title
US Phone Number with extension, flexible

Initial Tags
regex, phone, extension

Initial Language
Regular Expression