Finding [^/\\\\&<>\"]
will only check that at least one of the character isn't a forbidden one.
If you want to check that the whole string is made of allowed characters, you have to anchor the regex:
Pattern.compile("^[^/\\\\&<>\"]*$").matcher(inputText).find();
With ^$
matching the beginning and end of the string.
Or, as pointed out by @devnull, you can use String.matches
wihch anchors the regex by default:
inputText.matches("[^/\\\\&<>\"]*")