my $re = qr[^[0-9a-zA-Z.\\/_%$'(){}&!~`@#^-]+$];; print $string !~ $re ? 1 : 0;;