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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^(\([2-9]|[2-9])(\d{2}|\d{2}\))(-|.|\s)?\d{3}(-|.|\s)?\d{4}$
Description
Telephone validator allowing user to enter 10 digit telephone number with segments of number separated by hyphens, periods or spaces. Also braces allowed around area code.
Matches
213-123-1234 | 2131231234 | (213) 123-1234
Non-Matches
123-123-1234
Author Rating: The rating for this expression. MARK J KRISBURG
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: Doesn't support international numbers and doesn't mention which national pattern its matching
Name: MikeT
Date: 2/7/2014 6:24:53 AM
Comment:
Most countries use a different pattern for telephone numbers for example all UK numbers start with a 0, which this pattern disallows, also UK numbers can be 10 or 11 digits. so you should mention the national pattern you are following that i assume is USA


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