perl -le '$s="a1, a3 - a5\na11"; while ($i<10) { $i++; $s=~/a(\d+)/g; print $1; }'