1 文件名在操作系統中不允許出現 / \ " : | * ? < >
2 效驗代碼
String fileName="<>?.xml";
boolean isPass = fileName.matches("[^\\s\\\\/:\\*\\?\\\"<>\\|](\\x20|[^\\s\\\\/:\\*\\?\\\"<>\\|])*[^\\s\\\\/:\\*\\?\\\"<>\\|\\.]$");
System.out.println(isPass);
//結果: false
