class of all characters that are [^-[:^punct:]] ^ ^ | | | +--- and also not a not-punct (i.e., or is a [:punct:]) | +--- not a hyphen #### Win8 Strawberry 5.8.9.5 (32) Sat 05/07/2022 18:36:51 C:\@Work\Perl\monks >perl use strict; use warnings; for my $char (split '', '#%-&*') { printf "'%s' %smatch \n", $char, $char =~ m{ \A [^-[:^punct:]] \z }xms ? '' : 'NO ' ; } ^Z '#' match '%' match '-' NO match '&' match '*' match