Title |
Test
Find
US Phone Number
|
Expression |
^1?[-\. ]?(\(\d{3}\)?[-\. ]?|\d{3}?[-\. ]?)?\d{3}?[-\. ]?\d{4}$ |
Description |
US Phone number with optional leading 1, optional area code, and optional delimiters (hyphen, space or period) |
Matches |
18005551212 1.800.555.1212 1-800-555-1212 (800)555-1212 8005551212 800-555-1212 800.555.1212 5551212 555-1212 555.1212 |
Non-Matches |
2-800-555-1212 55-51212 551212 15551212 |
Author |
Rating:
Jason Kittredge
|
Source |
|
Your Rating |
|
Title: This is exactly what I am looking for
Name: Jia Li
Date: 10/23/2006 2:55:44 PM
Comment:
This expression solves our problem. We have existing phone records in many formats like these. It gives a lot of flexibility for users.
Title: my first post - just asking...
Name: seth gordon
Date: 8/21/2006 8:41:38 PM
Comment:
why not
^1?[-\. ]?\(?(\d{3})?\)?[-\. ]?\d{3}?[-\. ]?\d{4}$