in reply to Regex and \G
You can intermix "m//g" matches with "m/\G.../g", where "\G" is a zero-width assertion that matches the exact position where the previous "m//g", if any, left off. Without the "/g" modifier, the "\G" assertion still anchors at pos(), but the match is of course only attempted once. Using "\G" without "/g" on a target string that has not previously had a "/g" match applied to it is the same as using the "\A" assertion to match the beginning of the string.
_________
broquaint
|
|---|