JS正则匹配待重命名文件名
<script>
var str = "123 - Copy(2).csv";
var regExp = /^123( - Copy(\(\d+\))?)?.csv$/;
document.writeln( regExp.test( str ) ); // true
</script>
公众号:金木编程
<script>
var str = "123 - Copy(2).csv";
var regExp = /^123( - Copy(\(\d+\))?)?.csv$/;
document.writeln( regExp.test( str ) ); // true
</script>