in reply to (Ovid) Re: Ovid, Long Live .*? (dot star question-mark)
in thread Ovid, Long Live .*? (dot star question-mark)

Ok. Allow me to explain how the optimization works. If a quantifier is proceeded by an exact character, then the quantifier knows how far ahead it can jump safely, so it doesn't have to match character-by-character.

If the quantifier is inside capturing parens, this optimization is not on, because the node after the quantifier is not an exact character, but the node for signalling the closing of the paren.

My optimization tells perl to look beyond a closing paren. Technically, it should also look past ANY closing parens (not just one). And perhaps code evaluations as well...

The optimization does depend on the frequency of that "jump ahead" character.

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

  • Comment on Re: (Ovid) Re: Ovid, Long Live .*? (dot star question-mark)