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. ++