Displaying page
of
pages;
Items to
Title |
Test
Details
Regular Expression for Phone Numbers in the US
|
Expression |
/^(1)?(-|.)?(\()?([0-9]{3})(\))?(-|.)?([0-9]{3})(-|.)?([0-9]{4})/
|
Description |
I was looking for a regex that allows pretty much any combo of a US phone number. I found some that covered most of the bases, but not all of them.
This regex allows for missing characters, periods, hyphens. It should cover most of the bases. If not, let me know! I want to make it better!
|
Matches |
1231231234 | 11231231234 | 1-1231231234 | 1123-1231234 | 1123123-1234 | 1-123-1231234 | 1-123123-1234 | 1123-123-1234 | 1-123-123-1234 | (1231231234 | 123)1231234 | (123)1231234 | (123)-1231234 | (123)123-1234 | (123)-123-1234 | (123-1231234 | (123123-1234 | 123)-1231234 | 123)123-1234 | (123-123-1234 | 123)-123-1234 | 1(123)1231234 | 1(1231231234 | 1123)1231234 | 1-(1231231234 | 1-123)1231234 | 1-(123)1231234 | 1-(123-1231234 | 1-(123123-1234 | 1-123)-1231234 | 1-123)123-1234 | 1-(123)-1231234 | 1-(123)123-1234 | 1-(123)-123-1234 | -1231231234 | -123-1231234 | -123123-1234 | -123-123-1234 | -
|
Non-Matches |
)123(1231234 | 123-1233-123 | (123(1231234
|
Author |
Rating:
sebastian frohm
|
Displaying page
of
pages;
Items to