in reply to Regex: continue from previous match
But I don't want to match only at that position, like the \G anchor would have.
Then don't use \G. Without \G the construct does exactly what you want:
use 5.010; $_ = 'aaababaab'; while (/(a+)/pcg) { say pos($_), " ", $1; } __END__ 3 aaa 5 a 8 aa
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex: continue from previous match
by John M. Dlugosz (Monsignor) on Apr 23, 2011 at 08:13 UTC | |
by moritz (Cardinal) on Apr 23, 2011 at 08:39 UTC |