in reply to Re^2: The sum of absolute differences in the counts of chars in two strings.
in thread The sum of absolute differences in the counts of chars in two strings.

How about count others (not agct) as an exception?

my $aa="AGCTAAABBBCCC"; my %k=(a=>"a",g=>"g",c=>"c",t=>"t",else=>"[^agct]"); my %all; while( my($k,$pattern)=each %k ){ $all{$k}++ while ($aa =~ m/$pattern/gi); }
  • Comment on Re^3: The sum of absolute differences in the counts of chars in two strings.
  • Download Code