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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Phone matcher for NANP telephone number
Expression
(?:\([2-9][0-8]\d\)\ ?|[2-9][0-8]\d[\-\ \.\/]?)[2-9]\d{2}[- \.\/]?\d{4}\b
Description
Matches NANP requirements for valid telephone numbers in the USA, its territories, Canada, Bermuda, and 16 Caribbean nations.<br> Area code: [2-9][0-8][0-9]<br> Exchange code: [2-9][0-9][0-9]<br> Station code: [0-9][0-9][0-9][0-9]<br> Accepts common phone number separators like parentheses, dash/hyphen, slash, period, and space. Stops matching at any word boundary, including end of line. Adapted from Don Johnston's pattern.
Matches
8296399623 | 741 556-4630 | 319.380.3232 | (859)673.5793 | 660/471.5749
Non-Matches
(195)979-5873 | 763 027 5552 | 596 270.0326 | 8915551212
Author Rating: Not yet rated. Gregory Krohne
Source http://regexlib.com/REDetails.aspx?regexp_id=607
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-2018, RegexAdvice.com | ASP.NET Tutorials