in reply to position after global matches?
So, obviously, the /g leaves me positioned at the end of each successive match. But, if I wanted to also match at positions 6 and 10, would I need to respecify pos to be the beginning of the previous match +1 character? Is there a better, more straightforward way to do this? Am I just missing something simple?
Judging from code like GrandFather's at finding number of contiguous letters, there may be other and somewhat more terse ways. But personally I'd do it like you suggested, and that would be clearer for me to understand. Of course It will be enough to step back by -2 on the current pos.
Fortunately IIRC Perl 6 will provide simple single modifiers to do this kind of things out of the box. (In spite of those who claim it's "too much complexity". ;-)
|
|---|