>perl -le"$|=1; ($_='abc') =~ s/\G(.)/print(pos(),' ',$1); pos()=0/eg" 0 a 1 b 2 c [download]
In reply to Re: Resetting pos() within a RegEx? by ikegami in thread Resetting pos() within a RegEx? by LanX