- //&cls&cscript -nologo -e:jscript "%~f0"<"文本.txt" "指定字符串" >"结果.txt"&pause&exit
- var reg = new RegExp('(^|.+[\\r\\n]).*?'+WSH.Arguments(0).replace(/[\*\.\?\+\$\^\[\]\(\)\{\}\|\/]/g,'\\$&')+'.*([\\r\\n]|$)', 'g');
- WSH.echo(WSH.StdIn.ReadAll().replace(reg, ''));
复制代码
|