Then don't use \G
while ('abxxxacxxxad' =~ /a(.)/g) { say $1; } [download]
In reply to Re: Regex: continue from previous match by ikegami in thread Regex: continue from previous match by John M. Dlugosz