my $re = '(^|,)(' . join('|', sort { $b cmp $a } keys %id_for) . ')(?=,|$)';