Title |
Test
Find
US Phone Number
|
Expression |
^(1?(?: |\-|\.)?(?:\(\d{3}\)|\d{3})(?: |\-|\.)?\d{3}(?: |\-|\.)?\d{4})$ |
Description |
This is my simple phone number regex. There are many like it but this is mine. It accepts the most common United States phone number formats that normal people use. The number 1 at the beginning is optional and so is the separators. The separators can be a dash (-), a period (.) or a space. Putting the area code in parenthesis is also an option. That's about it. |
Matches |
1-234-567-8910 | (123) 456-7891 | 123.456.7891 | 12345678910 |
Non-Matches |
12-345-678-9101 | 123-45678 | 123456789101 |
Author |
Rating:
tedcambron
|
Source |
|
Your Rating |
|
Title: Tough Crowd
Name: Ted Cambron
Date: 2/15/2008 11:24:52 AM
Comment:
How can you not give this a good rating? This little beauty works perfectly as described. What else could you ask for?