Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: How do I parse a telephone number?

by chromatic (Archbishop)
on Jul 12, 2000 at 00:28 UTC ( [id://22100]=note: print w/replies, xml ) Need Help??


in reply to How do I parse a telephone number?

Here's a regex-less solution:

sub parse_phonenumber { local $_ = shift; tr/()\- //d; # eliminate punctuation my( $are, $three, $four ); my $line = substr $_, -4, 4, ''; my $exch = substr $_, -3, 3, ''; my $area = substr $_, -3, 3, ''; ( $area, $exch, $line ) }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2024-03-28 09:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found