Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: regular expression

by trizen (Friar)
on Feb 15, 2012 at 15:58 UTC ( #953985=note: print w/ replies, xml ) Need Help??


in reply to regular expression

Regex:

my $str = '4512872356698'; $str =~ s/^\d{6}\K\d+(?=\d{4})/'X' x ($+[0] - $-[0])/e; print "$str\n";
Substr:
my $str = '4512872356698'; substr($str, 6, -4, 'X' x (length($str) - 10)); print "$str\n";


Comment on Re: regular expression
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2014-08-28 11:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (259 votes), past polls