Title |
Test
Find
U.S. Phone numbers
|
Expression |
^(((\(\d{3}\)|\d{3})( |-|\.))|(\(\d{3}\)|\d{3}))?\d{3}( |-|\.)?\d{4}(( |-|\.)?([Ee]xt|[Xx])[.]?( |-|\.)?\d{4})?$ |
Description |
with or without area code (of various forms)(does not allow for unbalanced parens in the area code). With or without an extension (of various forms). Does not allow for leading or trailing space. |
Matches |
(123)-456-7890 Ext 1234 | 123-456-7890 | (123).456.7890 | 123.456.7890 | 1234567890ext1234 | 123-456 7890 X 1234 |
Non-Matches |
123)4567890 | 800callcat | 123456789 |
Author |
Rating:
Not yet rated.
Rick LaCount
|
Source |
|
Your Rating |
|
Title: Works good but..
Name: Tester
Date: 3/30/2007 10:15:35 AM
Comment:
Why does the extension, if you use one, have to be 4 digits?? Why not between 2 and 4 digits or something. I would really like to use it but the extension must be more flexible.