my $s = "one of his best tracks. It's good. His other notew"; $s =~ s/([.?!])[^.?!]*$/$1/; print $s, "\n"; __OUTPUT__ one of his best tracks. It's good.