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';