Re: regex, number of matches

Abigail schreef:
> Dr.Ruud:

>> 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
pattern matches.

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.

Affijn, Ruud

"Gewoon is een tijger."