Well, if you're going to keep a list of area codes, and reject numbers whose first three digits aren't on that list, why not maintain a list of exchange codes as well? I mean, if you're going to reject '123-456-7890' because '123' isn't a valid area code, shouldn't you also reject '212-555-7890', because '555' isn't a valid exchange code?
Of course, keeping a list of exchanges per area, that still isn't the end. Not all exchanges connect 10000 numbers. | [reply] |
Since I went to the website pointed to by beth, I know more than I ever wanted to about North American telephone numbers. About the only guarantee that seems to be present is that the area code (NPA) won't start with 1 or match /^[2-9]11/.
I think that the answer to the crux of the OP's question is that there is no guaranteed manner of distinguishing North American (not just US) fax numbers from voice numbers. Indeed, the same line can be used for either at any time. There's also no coding scheme that distinguishes US from any other North American phone numbers: the US does not have a distinct country code, as does, say, the UK, nor can US area codes be distinguished from those of Canada by a regular expression.
As to keeping a list of exchanges by area code, one can certainly do that, but I would suspect that this is going to be even more changeable than the list of area codes. The list of individual phone numbers will change even more rapidly than the list of exchanges.
When I was doing software development in the market research industry (NOT TELEMARKETING), my then-employer contracted with more than one of the companies that actually maintain lists of residential vs business vs fax vs cell numbers so that our pollsters would call only residential numbers. The pollsters still called fax, cell, and business numbers by mistake, as the services couldn't keep up.
Information about American English usage here and here. Floating point issues? Please read this before posting. — emc
| [reply] [d/l] |
I *do* keep a list of area codes (admittedly not 100% up to date, but I do try to keep it updated). I don't keep a list of exchange codes, because the information doesn't appear to be available in a convenient form.
And the 123 area code isn't rejected because it doesn't exist, it's rejected because it's badly formed and such an area code can *never* exist in the current NANP.
| [reply] |