Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Trim Phone Numbers

by bv (Friar)
on Dec 15, 2009 at 04:20 UTC ( #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
Node Status?
node history
Node Type: note [id://812810]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2019-12-15 23:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?