I tried to figure out how this exploded regular expression for two hours !!! At midnight I have to understand this and go to bed!
String str = new String("filename\\");
if(str.matches(".*[?/<>|*:\"{\\}].*")) {
System.out.println("match");
}else {
System.out.println("no match");
}
".*[?/<>|*:\"{\\}].*"- my expression in the expression. He catches everything correctly, except for the backslash !!! I need to know how to catch the backslash correctly, please help!
FYI, the illegal characters I'm trying to catch is this? \ / <> | *: "I have a working exception for the backslash
source
share