>>183
これがお望みのものか?

$str = "AoUDqGrsqcUSgVGsCphafNXhkEtsfCcANeLDsTFq";
$cnt = 1 ;
$str =〜 s/[C-G][pqst]/$cnt ++/eg ;
print $str . "\n" ;