my %counts; $counts{$1}++ while $string =~ /([^,]+)/g;