正则表达式

public static boolean isValidFileName2(String fileName) {
		if (fileName == null || fileName.length() > 255)
			return false;
		else
			return fileName.matches("[^\\s\\\\/:\\*\\?\\\"<>\\|]*");
	}

相关推荐