Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Trim Phone Numbers

by bv (Friar)
on Dec 15, 2009 at 04:20 UTC ( [id://812810]=note: print w/replies, xml ) Need Help??


in reply to Trim Phone Numbers

perl -lnpe 's/.*(?=\d{3}-?\d{4}$)/*/'

or another interpretation of your question:

perl -lnpe 's/(\d\d-?)(\d{3}-?)(?=\d{3}-?\d{4}$)/$1=~tr!0-9!*!;$2=~tr!0-9!*!;$1.$2/e

@_=qw; Just another Perl hacker,; ;$_=q=print "@_"= and eval;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-19 10:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found