String s1 = "[dssdfgfdg";
String s2 = "]23adsa";
String s3 = "23adsa";
System.out.println(s1.matches(".*[\\[\\]].*")==true?"包含":"不包含");
System.out.println(s2.matches(".*[\\[\\]].*")==true?"包含":"不包含");
System.out.println(s3.matches(".*[\\[\\]].*")==true?"包含":"不包含");