The rules that I used in my perl code to verify NANP phone numbers came from a letter sent by Doug Newel to the telnum-l mailing list, which I will reproduce below, is somewhat simplified to consider only 10-digit numbers:
The number 10 digits long. We'll call this pattern: ABC DEF XXXX A may not be 0 or 1. B may not be 9. A+B may not be 37 or 96. B+C may not be 11. D may not be 0 or 1.
You can extract the regular expression from the libphonenumber metadata , but be careful, this is GNARLY AS HELL.
source share