$perl -e '$_="abbbabc"; while (/(b*)/g) { print "($1)\n" }' () (bbb) () (b) () ()