Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: regular expression

by moritz (Cardinal)
on Feb 15, 2012 at 12:56 UTC ( [id://953938]=note: print w/replies, xml ) Need Help??


in reply to Re^2: regular expression
in thread regular expression

... and my solution replaces them all by X. Is that not what you want?

If you only want to replace digits in there, you can also say

substr($str, 6, $len - 10) =~ s/\d/X/g

Replies are listed 'Best First'.
Re^4: regular expression
by Crackers2 (Parson) on Feb 15, 2012 at 16:07 UTC

    Slight variation so you don't need the length:

    substr($str, 6, -4) =~ s/./X/g;
Re^4: regular expression
by Don Coyote (Hermit) on Feb 15, 2012 at 13:22 UTC

    Inspiring. Subtracting the sum of the value of the length of the first and last visible digits to establish the variable length of the middle section. ++

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-23 06:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found