Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: phone number regex

by coec (Chaplain)
on Mar 10, 2004 at 05:21 UTC ( [id://335359]=note: print w/replies, xml ) Need Help??


in reply to phone number regex

Its Ugly But It Works(tm)
#!/usr/bin/perl -w while (<DATA>) { $num = join "-", split /\D+/; $num =~ s/^-//; print "$num\n"; } __DATA__ (01)1234 5678 (01) 1234 5678 01-1234-5678 01 1234 5678 01 234 4567
Updated
Not so ugly now...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-24 17:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found