Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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


Comment on Re: numbers masking
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (10)
As of 2014-09-22 19:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (198 votes), past polls