my $line = 'abc123def456ghi'; print $1,"\n" while ($line =~/\w+?(\d+)/g);