I have a file name, lets say upload 23_3.jpg. I would like to allow only letters, (.) period, (-) hypen sign, underscore (_)
Pattern p = Pattern.compile("[^a-z0-9_.]", Pattern.CASE_INSENSITIVE);
Matcher m = p.matcher(i.getFileName());
boolean specialCharFound = m.find(); //this will return true if any other characters are found
^ means not a-z, letters and I added _ and ., but it doesn't work. Any idea how to add '_' '.' '-' characters?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…