A failed match or changing the target string resets the position. If you don't want the position reset after failure to match, add the //c, as in /regexp/gc. The current position in the string is associated with the string, not the regexp. This means that different strings have different positions and their respective positions can be set or read independently.I interpreted the third sentence to mean the opposite of what it meant.
There doesn't seem to be anything on /c or /gc in perlre at all, except for a "see also" reference to perlretut. Perlre is the only Reference Manual page to cover regexes, and I think it should at least mention /c and not simply refer people to a Tutorials page.
In reply to Re: Global regex giving up too soon
by Wassercrats
in thread Global regex giving up too soon
by Wassercrats
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |