- or download this
perl -e 'print map {++$count," : ",$_,"\n"}split /(a|b)+/,"a12cdabab"'
1 :
2 : a
3 : 12cd
4 : b
- or download this
perl -e 'print map {++$count," : ",$_,"\n"}split /((?:a|b)+)/,"a12cdab
+ab"'
1 :
2 : a
3 : 12cd
4 : abab
- or download this
perl -e 'print map {++$count," : ",$_,"\n"}split /(?:a|b)+/,"a12cdabab
+"'
1 :
2 : 12cd