regEx会冻结屏幕。我有用于验证文件名的代码,并且添加了一些额外的字符(如“ {”或“ [”)时,屏幕冻结了
var acceptFileTypes = /^([a-z\s*\_*\-*\(*\)*\,*\'*\;*\&*\$*\#*\@*\.*\!*0-9]+)+\.(xlsx|ppt|pptx|doc|docx|pdf|tiff|tif|msg)$/i;
var fileName="business business business business business business return preparation business [.docx"
acceptFileTypes.test(fileName)