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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find North American Phone Number Pattern
Expression
^\(\d{3}\)\s?|\d{3}(\.|-|\s)?)\d{3}(\.|-|\s)?\d{4}$
Description
Checks the format of a North American phone number with area code.
Matches
(999) 999-9999, 999.999.9999, 999-999-9999,
Non-Matches
999,999,9999, 999-9999
Author Rating: Not yet rated. Keith Stacy
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: Causes Error
Name: Jack
Date: 12/19/2013 3:05:55 PM
Comment:
parsing "^\(\d{3}\)\s?|\d{3}(\.|-|\s)?)\d{3}(\.|-|\s)?\d{4}$" - Too many )'s.


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