Re: regex, number of matches
- From: "Dr.Ruud" <rvtol+news@xxxxxxxxxxxx>
- Date: Sat, 24 Sep 2005 11:14:34 +0200
Abigail schreef:
> Dr.Ruud:
>> There is a problem with the benchmark, because [of what] perlre(1)
says
> 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."
.
- Follow-Ups:
- Re: regex, number of matches
- From: Abigail
- Re: regex, number of matches
- From: Tad McClellan
- Re: regex, number of matches
- References:
- regex, number of matches
- From: Dr.Ruud
- Re: regex, number of matches
- From: John Bokma
- regex, number of matches
- Prev by Date: Re: $ENV{'CONTENT_LENGTH'} / STDIN
- Next by Date: Re: $ENV{'CONTENT_LENGTH'} / STDIN
- Previous by thread: Re: regex, number of matches
- Next by thread: Re: regex, number of matches
- Index(es):