I use regex
r="[^A-Za-z0-9]+";
to detect if a string has one or more chars other than letters and digits;
Then I tried the following:
Pattern.compile(r).matcher(p).find();
I tested:
! @ # $ % ^ & * ( ) + =- [ ] \ ' ; , . / { } | " : < > ? ~ _ `
Most of the time, it works except backsplash \ and caret ^.
e.g.
String p = "abcAsd10^" (return false)
String p = "abcAsd10\\" (return false)
Anything I miss?