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

Re^3: Greediness of * vs. greediness of +

by JavaFan (Canon)
on Sep 08, 2010 at 13:57 UTC ( [id://859319]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Greediness of * vs. greediness of +
in thread Greediness of * vs. greediness of +

If you execute it a second time, it starts off from where it left.
If that where true, while (/(b*)/g) would never finish. It starts where it finished the previous time, unless it matched an empty string. In the latter case, pos() will be advanced by one. (Details are even more complicated. But documented. See the section "Repeated Patterns Matching a Zero-length Substring" in the perlre manual page.)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-03-28 21:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found