Re: regex, number of matches
- From: "Dr.Ruud" <rvtol+news@xxxxxxxxxxxx>
- Date: Sat, 24 Sep 2005 11:14:34 +0200
>> There is a problem with the benchmark, because [of what] perlre(1)
> I'm fully aware of the penalty associated with $& and friends.
> But why does that cause a problem with the benchmark?
My mistake again. I wrongly read the text about the "price for each
pattern that contains capturing parentheses" as also penalizing other
I find it hard to think of a reason why the first use of $& should harm
all other pattern matches. And then why ()/$1 doesn't. Because they can
be handled in about the same way. I haven't looked into the Perl-source
yet, this is as good a reason as any.
I like to see the benchmark without the ()/$1 test, to see if the
remaining cases behave about the same. That might need absolute scores
next to the percentages, so running on a system that doesn't do much
else. I'll try to arrange that later today or tomorrow.
"Gewoon is een tijger."