Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: numbers masking

by jwkrahn (Monsignor)
on May 16, 2012 at 08:03 UTC ( #970770=note: print w/replies, xml ) Need Help??


in reply to numbers masking

$ perl -le' my @numbers = ( "541321069873210200", "5413 21069873210200" ); my $start_at = 6; my $end_digits = 4; for ( @numbers ) { print; my $digit_count = tr/0-9//; my $replace_count = $digit_count - $end_digits; my $count = -1; s{ ( [0-9] ) }{ ++$count; $count >= $start_at && $count < $replace +_count ? "X" : $1 }xeg; print; } ' 541321069873210200 541321XXXXXXXX0200 5413 21069873210200 5413 21XXXXXXXX0200

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://970770]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2016-12-08 13:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (141 votes). Check out past polls.