[tpm] New Regex question - partially solved

Uri Guttman uri at stemsystems.com
Sat Oct 27 20:52:48 PDT 2012


On 10/27/2012 07:42 PM, Rob Janes wrote:
> Slurp the file and run the second regex.
>
> undef $/;
> $exp = <in>;
use File::Slurp is much better for that.

> $exp =~ s/(\s)\1+/\1/g;

i keep saying to not use \1 in the replacement. it is documented to be 
wrong but supported. don't use it there. use $1

uri


More information about the toronto-pm mailing list