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?? |
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.)
In Section
Seekers of Perl Wisdom
|
|