Win
文件路径
private static final String WIN_FILE_PATH_PATTERN = "^([a-zA-Z]:(([\\\\/])[^\\\\/:*?<>|]+)*([\\\\/])[^\\\\/:*?<>|]+\\.[^\\\\/:*?<>|]+,)*[a-zA-Z]:(([\\\\/])[^\\\\/:*?<>|]+)*([\\\\/])[^\\\\/:*?<>|]+\\.[^\\\\/:*?<>|]+$";
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/7a6045b42a76bc7fb536ec15bf3822c4.png)
文件夹路径
private static final String WIN_FILE_FOLDER_PATTERN = "^([a-zA-Z]:(([\\\\/])[^\\\\/:*?<>|]+)*([\\\\/])[^\\\\/:*?<>|]+\\.[^\\\\/:*?<>|]+,)*[a-zA-Z]:(([\\\\/])[^\\\\/:*?<>|]+)*([\\\\/])[^\\\\/:*?<>|.]+(/[^\\\\/:*?\"<>.|]|[/w,/s]*|[\\/])$";
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/70fc17fa99da2d5f9a0c9a3629bffd86.png)
Linux
文件路径
private static final String LINUX_FILE_PATH_PATTERN = "^((/[^\\\\/:*?\"<>|]+)*/[^\\\\/:*?\"<>|]+\\.[^\\\\/:*?\"<>|]+,)*(/[^\\\\/:*?\"<>|]+)*/[^\\\\/:*?\"<>|]+\\.[^\\\\/:*?\"<>|]+$";
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/4d5b5ae97ee42c085c874c90c1c2cefe.png)
文件夹路径
private static final String LINUX_FILE_FOLDER_PATTERN = "^((/[^\\\\/:*?\"<>|]+)*/[^\\\\/:*?\"<>|]+)*(/[^\\\\/:*?\"<>|]+)*/([^\\\\/:*?\"<>.|]|[/w,/s]*|[\\/])+$";
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/84a8b17916956ea3dd87471f0418c039.png)