I have the following method to check allowed characters:
private boolean checkIfAllCharsAreValid(String test) {
boolean valid = false;
if (test.matches("^[a-zA-Z0-9,.;:-_'\\s]+$")) {
valid = true;
}
return valid;
}
but if test has the character - in it the match return false. Do i have to escape the -?