Hello medium.dave, and welcome to the Monastery!
Within a regex, the special character ^ matches the beginning of the string,1 but you want to match the position where the previous match left off. For that, you need \G, on which see “Assertions” in perlre#Regular-Expressions.
Update: 1or at the beginning of the line if the regex has an /m modifier.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: Matching n characters with m//g
by Athanasius
in thread Matching n characters with m//g
by medium.dave
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |