>> Do you have a list of these special characters or do you mean all >> non-alphanumeric and non-whitespace: >> >> #!/usr/bin/perl >> >> use strict; >> use warnings; >> >> while( <> ){ >> if( /[^[:space:][:alnum:]]/ ){ >> print "invalid: $_"; >> } >> } >>
Yes all non-alphanumeric and non-whitespace. I have a database for people to search using a keyword or all alphanumerical words (including space) are valid, but no special characters. All the characters I am substituting below are invalid characters for the search. $string =~ s/\$%\?\^!\+\@'\\|`\?#~=\*><"//g; -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/