![]() |
|
"be consistent" | |
PerlMonks |
Re: understanding (*SKIP:...)by ikegami (Patriarch) |
on Jun 11, 2025 at 22:05 UTC ( [id://11165375]=note: print w/replies, xml ) | Need Help?? |
That (*SKIP:name) precedes (*MARK:name) in your pattern makes no sense, and leads me to think you believe a MARK is akin to a label and a SKIP is akin to a goto. That is not the case at all. What we're marking and skipping to are positions in the string being matched. (*MARK:name) bookmarks the current match position under the provided name.
Solution:
(*SKIP) was matched at position 2. When (*FAIL) caused the matching to backtrack through (*SKIP), everything before position 2 was eliminated from potential matches. Non-trivial example using (*MARK:...): If instead you want ab, you could use
This time, only the text before position 1 was eliminated from potential matches.
In Section
Seekers of Perl Wisdom
|
|