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]\d{2}-\d{3}-\d{4}$
Description
This expression matches a hyphen separated US phone number, of the form ANN-NNN-NNNN, where A is between 2 and 9 and N is between 0 and 9.
Matches
800-555-5555 | 333-444-5555 | 212-666-1234
Non-Matches
000-000-0000 | 123-456-7890 | 2126661234
Author Rating: The rating for this expression. Steven Smith
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: test
Name: test
Date: 10/30/2019 9:22:04 AM
Comment:
111-222-33


Title: Error
Name: Carol
Date: 2/20/2012 4:26:38 PM
Comment:
200-000-0000 is NEVER a legal phone number.


Title: Php developer
Name: Wasim
Date: 10/14/2011 8:58:07 AM
Comment:
Good Job


Title: Php developer
Name: Wasim
Date: 10/14/2011 8:57:50 AM
Comment:
Good Job


Title: .net Developer
Name: vinay
Date: 5/27/2008 5:21:14 AM
Comment:
Thanks ,for giving me a expressions


Title: Matches too many non-legal numbers
Name: Gregory Krohne
Date: 8/2/2007 11:07:35 AM
Comment:
Matches 898-898-8989, which is not a valid telephone number under the US rules. Specifically, the second digit of the area code can't be a 9.


Title: ASP.Net Developer
Name: LindaD
Date: 11/2/2006 4:44:54 PM
Comment:
Short, elegant and most of all, it worked for me. Thanks much.


Title: Phone validation
Name: Hiral Solanki
Date: 5/23/2006 6:55:04 AM
Comment:
extremly a good site i really very impress. thank to owner of this site.


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