sub remove_ctrls { my $s = shift; $s =~ tr/\x90\x8F//d; return $s; } $text =~ s/(<\/Mil.*?>.*?\x9D)/remove_ctrls($1)/esg;