Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Phone reg expression

by Abigail-II (Bishop)
on Apr 18, 2003 at 22:58 UTC ( [id://251572]=note: print w/replies, xml ) Need Help??


in reply to Re: Phone reg expression
in thread Phone reg expression

There are no patterns for phone numbers in Regexp::Common yet, for the simple reason I have not found a specification of phone numbers for any country yet.

For instance, a regexp that allows for 7 or 11 digit phone numbers would be incorrect for the North America Plan, as that would reject for instance 911.

Abigail

Replies are listed 'Best First'.
Re: Re: Phone reg expression
by seattlejohn (Deacon) on Apr 20, 2003 at 19:34 UTC
    For the obsessively curious, there's a lot of interesting (and apparently authoritative) information about U.S. and Canadian phone-number standards at NANPA, the North American Numbering Plan Adminstration. It covers arcana such as the so-called N11 numbers (911, 411, etc.), potentially valid area codes (/2-90-80-9/, except /\d11/, /37\d/, and /96\d/), vertical services codes (112?\d\d or \*2?\d\d), and so on. It even alludes to what will happen when North America eventually moves to 11-digit phone numbers (i.e., 4-digit area codes). Now there's a scary thought for anyone who's been writing phone-number validation code that assumes a 3-3-4 format.

            $perlmonks{seattlejohn} = 'John Clyman';

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://251572]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2024-04-19 20:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found