Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: regular expression

by trizen (Hermit)
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";

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 chanting in the Monastery: (10)
As of 2016-09-29 11:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (552 votes). Check out past polls.