in reply to Re: Capturing with look-ahead
in thread Capturing with look-ahead

The extra . isn't necessary, although I have a feeling it makes the regex more efficient.

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a (from-home) job
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Replies are listed 'Best First'.
Re: Re: Re: Capturing with look-ahead
by Ido (Hermit) on Mar 04, 2002 at 21:24 UTC
    Why is that? (?=) is zero-width, why does it look further one char next time?
      I direct your attention to perlre, the section named Repeated patterns matching zero-length substring. This complicated section can be summarized by this extract: "the following match after a zero-length match is prohibited to have a length of zero."

      _____________________________________________________
      Jeff[japhy]Pinyan: Perl, regex, and perl hacker, who'd like a (from-home) job
      s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

        Thanks!