# true if $string consists solely of allowed chars (and isn't empty) $string =~ m/^[\s\d-\(\)\.]+$/; # or, we could be true if $string contains anything except allowed chars $string =~ m/[^\s\d-\(\)\.]/;