in reply to Disabling regexp optimizations?

I might be responsible for that optimization. I made some modifications to the regex engine a couple years ago involving skipping non-pattern parts of regexes when looking to optimize. So, how can can you defeat it? Well, you could wrap the 'XXX' inside a (??{ ... }).
$rx = qr/.../; " failed " =~ /(?{ $ok = 1 })(??{ $rx })/; print "OK = $ok\n";

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart

Replies are listed 'Best First'.
Re^2: Disabling regexp optimizations?
by diotalevi (Canon) on Oct 15, 2005 at 18:28 UTC

    Even (??{ "XXX" }) is enough for that it seems. Thanks.