in reply to Re: Regexp map weirdness
in thread Regexp map weirdness
You probably meant m/t([^e]*)e/, m/wri([^e]*)en/); didn't you? :)) And a quick benchmark shows the speed advantage:
The longer the captured part, the better performs negchar. In the case of a failure, both methods take approx. the same time.Benchmark: timing 300000 iterations of dotstar, negchar... on string q +/tddddde/ dotstar: 1 wallclock secs ( 1.37 usr + 0.00 sys = 1.37 CPU) @ 21 +8658.89/s (n=300000) negchar: 0 wallclock secs ( 0.95 usr + 0.00 sys = 0.95 CPU) @ 31 +5457.41/s (n=300000) Rate dotstar negchar dotstar 218659/s -- -31% negchar 315457/s 44% --
-- Hofmator
|
|---|