in reply to Matching n characters with m//g
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, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Matching n characters with m//g
by medium.dave (Novice) on Feb 22, 2016 at 05:06 UTC | |
by medium.dave (Novice) on Feb 22, 2016 at 05:08 UTC |