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}\)\s?[0-9]{3}(-|\s)?[0-9]{4}$|^[0-9]{3}-?[0-9]{3}-?[0-9]{4}$
Description
US telephone check
Matches
1231231234 | (123)123-1234 | 123-123-1234
Non-Matches
12312312345 | (123)-123-1234 | 123
Author Rating: Not yet rated. PJ Bijoy
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: not working
Name: xxx
Date: 1/5/2009 8:24:24 AM
Comment:
above given regular expression is not working this allow (123)1234567 this number ?


Title: US telephone
Name: PJ Bijoy
Date: 7/1/2004 5:04:32 PM
Comment:
Update to the script because it is not working in some java scrip environment ^[(][0-9]{3}[)][ ]?[0-9]{3}(-|[ ])?[0-9]{4}$|^[0-9]{3}-[0-9]{3}-[0-9]{4}$|^[0-9]{3}[ ][0-9]{3}[ ][0-9]{4}$|^[0-9]{3}[0-9]{3}[0-9]{4}$


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