##
$perl -e '$_="abbbabc";
while (/(b*)/g) { print "($1)\n" }'
()
(bbb)
()
(b)
()
()
##
##
abba
| match zero b's before a
^abba
| match zero b's again. Don't substitute here, bump along
^abba
| match 'bb'
^a^a
| match zero b's
^a^^a
| match zero b's, don't substitute but bump along
^a^^a^
| match zero b's, don't substitute but bump along
##
##
$ perl -le '$_ = "abba"; s/b*/print pos; "^"/eg; print'
0
1
3
4
^a^^a^