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

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details U.S. Phone Number
Expression
1?(?:[.\s-]?[2-9]\d{2}[.\s-]?|\s?\([2-9]\d{2}\)\s?)(?:[1-9]\d{2}[.\s-]?\d{4}\s?(?:\s?([xX]|[eE][xX]|[eE][xX]\.|[eE][xX][tT]|[eE][xX][tT]\.)\s?\d{3,4})?|[a-zA-Z]{7})
Description
More complete than other patterns I could find here. Matches U.S. Phone numbers with various formats. Invalid area codes (that start with a 0 or 1) are excluded, as well as invalid exchanges (that start with 0). Allows, alphabetical exchange+local parts, and many extension notations. Dash and dot delimiters allowed except adjacent to a parenthetical area code. Letters may be used in place of any numbers except the country code and area code.
Matches
8005554444|1 (800) 555-4444 ext. 6666|1-800-NUMBERS
Non-Matches
180033344444|3334444|1110524444
Author Rating: The rating for this expression. Trampas Kirk
   Displaying page 1 of 1 pages; Items 1 to 1

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