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 Phone number
Expression
^((([\(]?[2-9]{1}[0-9]{2}[\)]?)|([2-9]{1}[0-9]{2}\.?)){1}[ ]?[2-9]{1}[0-9]{2}[\-\.]{1}[0-9]{4})([ ]?[xX]{1}[ ]?[0-9]{3,4})?$
Description
This regex matches US and CAN phone numbers with area code and optional 3 or 4 digit PBX extention. It does not check for validity of area code or exchange number, other than for starting with a 0 or 1.
Matches
(555) 687-6076 X 1234 | (555) 687-6076 | 555.687.5511x1234
Non-Matches
555.687.6076 ext 1234
Author Rating: Not yet rated. Josh de Boer
   Displaying page 1 of 1 pages; Items 1 to 1

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