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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find USA Phone
Expression
^(\d)?[ ]*[\(\.\-]?(\d{3})[\)\.\-]?[ ]*(\d{3})[\.\- ]?(\d{4})[ ]*(x|ext\.?)?[ ]*(\d{1,7})?$
Description
Requires area code. Allows extension. Any common US format works. If you prefer not to require area code, use this: ^(\d)?[ ]*[\(\.\-]?(\d{3})?[\)\.\-]?[ ]*(\d{3})[\.\- ]?(\d{4})[ ]*(x|ext\.?)?[ ]*(\d{1,7})?$
Matches
1 (123) 123-1234 ext. 1234567 | 1 (123) 123-1234 | (123) 123-1234 | (123)123.1234 | 1-123-123-1234 | 1231231234
Non-Matches
123/1234 L. 12345678
Author Rating: Not yet rated. Rob Eberhardt
Source Me
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

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