in reply to Regex combining /(foo|bar)/ slower than using foreach (/foo/,/bar/) ???
I think that your proposed optimization isn't as straightforward as you think. Consider:
$string = "fooar" $string =~ s/(foo|bar)/b/g; print $string;
vs.
$string = "fooar" $string =~ s/$_/b/g for (qr/foo/, qr/bar/); $print $string;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex combining /(foo|bar)/ slower than using foreach (/foo/,/bar/) ???
by Anonymous Monk on Feb 19, 2005 at 07:52 UTC | |
by hardburn (Abbot) on Feb 21, 2005 at 14:21 UTC |