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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find US Area Code (NANPA Format)
Expression
^[2-9]{1}[0-9]{1}((?<!1)[1]|[0]|[2-9]){1}\b
Description
According to NANPA (North American Numbering Plan Administration): The format of an area code is NXX, where N is any digit 2 through 9 and X is any digit 0 through 9. N11 are ERCs, called service codes, and are not used as area codes. This regex checks for these conditions. However, this regex does not check for N9X which are reserved for expansion in the future nor 37X or 96X which are also reserved for potential expansion in the future.
Matches
513
Non-Matches
211
Author Rating: Not yet rated. Grant Szabo
Source 513
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-2025, RegexAdvice.com | ASP.NET Tutorials