in reply to Exception from a character class
You're already showing how to use a zero-width assertion, so why not use that to exclude the apsotrophe?
Alternately, how about$text =~ s{(?!')\p{Punct}}{}g;
{ no warnings "uninitialized"; $text =~ s{(')|\p{Punct}}{$1}g; }
Update: a third solution is to match what you want to keep.
$text = join "", $text =~ m{[\x27\P{punct}]+}g;
In Section
Seekers of Perl Wisdom