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 Awesome US phone number matching
Expression
(?:\+?1[ .*-]?)?(?:\(? ?)?\d{3}(?: ?\)?)? ?(?:\*|(?:\.|-){1,2})? ?\d{3} ?(?:\*|(?:\.|-){1,2})? ?\d{4}
Description
This regex matches US phone number formats that I found to be commonly used. This regex is best used on scanning text. If html is present, strip out the html first.
Matches
5555555555 | 555 555 5555 | 555-555-5555 | (555-555-5555 | ( 555-555-5555 | 555) 555-5555 | 555 ) 555- 5555 | 555 ) 555-5555 | (555)555-5555 | (555) 555-5555 | (555) 555 5555 | (555) 555 - 5555 | (555) 555 -5555 | 555 - 555 - 5555 | (555)-555-5555 | 555 555-5555 | 555 -555-5555 | 555.555.5555 | 555-555.5555 | 555. 555.5555 | 555. 555. 5555 | 555*555*5555 | 15555555555 | 1 555 555 5555 | 1-555-555-5555 | 1.555-555-5555 | 1*555*555*5555 | +1 555 555 5555 | +1-555-555-5555 | +1 555-555-5555 | +1.555-555-5555 | +1.555.555.5555 | 1 (555) 555-5555 | +1 (555) 555-5555 | 1 5555555555 | 1.(555-555-555
Non-Matches
anything else
Author Rating: The rating for this expression. Ray Solomon
   Displaying page 1 of 1 pages; Items 1 to 1

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