Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Re: Capturing with look-ahead

by japhy (Canon)
on Mar 04, 2002 at 21:02 UTC ( [id://149214]=note: print w/replies, xml ) Need Help??


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!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://149214]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-20 03:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found