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


In reply to Re^5: Regular expression for Fax numbers by swampyankee
in thread Regular expression for Fax numbers by dxxd116

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.