ladoix% cat 312141.pl #!usr/bin/perl use strict; use warnings; my $phrase1 = "This is a test, \"using quotes of 'two different' types.\""; $phrase1 =~ s/[\S\W]*//g; print "P1: [$phrase1]\n"; my $phrase2 = "This is a test, \"using quotes of 'two different' types.\""; $phrase2 =~ s/[\S\w]*//g; print "P2: [$phrase2]\n"; my $phrase3 = "This is a test, \"using quotes of 'two different' types.\""; $phrase3 =~ s/[\s\W]*//g; print "P3: [$phrase3]\n"; my $phrase4 = "This is a test, \"using quotes of 'two different' types.\""; $phrase4 =~ s/[\s\w]*//g; print "P4: [$phrase4]\n"; my $phrase5 = "This is a test, \"using quotes of 'two different' types.\""; $phrase5 =~ s/[^\s\w]*//g; print "P5: [$phrase5]\n"; my $phrase6 = "This is a test, \"using quotes of 'two different' types.\""; $phrase6 =~ s/[^\S\w]*//g; print "P6: [$phrase6]\n"; my $phrase7 = "This is a test, \"using quotes of 'two different' types.\""; $phrase7 =~ s/[^\s\W]*//g; print "P7: [$phrase7]\n"; my $phrase8 = "This is a test, \"using quotes of 'two different' types.\""; $phrase8 =~ s/[^\S\W]*//g; print "P8: [$phrase8]\n"; ladoix% perl 312141.pl P1: [] P2: [ ] P3: [Thisisatestusingquotesoftwodifferenttypes] P4: [,"''."] P5: [This is a test using quotes of two different types] P6: [Thisisatest,"usingquotesof'twodifferent'types."] P7: [ , " ' ' ."] P8: [This is a test, "using quotes of 'two different' types."]