RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

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: The rating for this expression. tedcambron
Source
Your Rating
Bad Good

Enter New Comment

Title
 
Name
 
Comment
 
Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

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?


Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials