while ($string =~ /([CSH][CSHL]*[CSH])/g) { print "$1, "; }