in reply to Re: Efficiently create an IF/ELSE regex
in thread Efficiently create an IF/ELSE regex
Thank you, this is what I was looking for:
my %whitespace = ( "\n" => "n", "\t" => "t", "\r" => "r", "\f" => "f", ); my $fixid =~ s/(\s)/\\$whitespace{$1}/g;
I find it more efficient to complete a full test, than test multiple times.
Thanks,
jcrush
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Efficiently create an IF/ELSE regex
by Anonymous Monk on May 01, 2015 at 20:16 UTC |