windows文件名非法字符过滤检测-正则表达式

 过滤文件名非法字符 

windows现在已知的文件名非法字符有 / : * ? " < > |

var reg = new RegExp('[\\/:*?"<>|]');
if(reg.test(name)){
                //文件名含有非法字符()
            }
原文地址:https://www.cnblogs.com/zhidong123/p/7479644.html