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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^(\(?[0-9]{3}[\)-\.]?\ ?)?[0-9]{3}[-\.]?[0-9]{4}$
Description
Simple US phone number matching, allowing area code or not. Allows spaces, dashes, dots, or none of the above. Area code, if entered, can be surrounded by parenthesis or not.
Matches
(555) 555-5555 | 555.555.5555 | 555-5555
Non-Matches
(555)-555-5555
Author Rating: The rating for this expression. Dan Breen
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: Authors Note 2
Name: Dan Breen
Date: 6/3/2004 2:26:02 PM
Comment:
I forgot a space in the original expression...the latest is: ^(\(?[0-9]{3}[\)-\.]?\ ?)?[0-9]{3}[-\.\ ]?[0-9]{4}$


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