Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: strange behaviour: continue with \G and /gc and look forward

by tybalt89 (Monsignor)
on Dec 13, 2019 at 21:12 UTC ( [id://11110089]=note: print w/replies, xml ) Need Help??


in reply to strange behaviour: continue with \G and /gc and look forward

The higher-level loops preserve an additional state between ite +rations: whether the last match was zero-length. To break the loop, the following match after a zero-length match is prohibited to have + a length of zero. This prohibition interacts with backtracking ( +see "Backtracking"), and so the second best match is chosen if the +best match is of zero length.

Replies are listed 'Best First'.
Re^2: strange behaviour: continue with \G and /gc and look forward
by leszekdubiel (Scribe) on Dec 13, 2019 at 21:35 UTC

    Ok thank you very much. Community around perl is great. Actually I've been programming perl for a long time and this bite me for the first time.

    Here is the link:

    https://perldoc.perl.org/perlre.html#Backtracking

    search for phrase " higher-level loops "

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-19 05:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found