本帖最后由 3518228042 于 2017-5-28 19:49 编辑
- @set @n=0;/* & echo off
- dir /b *.htm *.html|cscript -nologo -e:jscript "%~0"
- pause & exit/b & rem */
- fso = new ActiveXObject("Scripting.FileSystemObject");
- while (!WSH.StdIn.AtEndOfStream) {
- f = WSH.StdIn.ReadLine();
- txt = fso.OpenTextFile(f, 1).ReadAll();
- txt = txt.replace(/ *<h1> ?第?([一二两三四五六七八九十○零百千0-91234567890]{1,9})([章节][ ]*)?([^ <]*)<\/h1>/ig,"\r\n<h1>第$1章 $3<\/h1>")
- //<h1>标签章节名规范
- .replace(/( | )([^<]+)([ \r\n]*\t*)* *(<\/[^>]+>)/ig,"$1$2<br />")
- //小段落后面无<br />去除回车换行添加<br />
- .replace(/[ ]*(<\/p>|<br ?\/?>|<\/div>|<\/title>)/ig,"$1\r\n")
- //小段落去除空字符
- .replace(/(<\/p>|<\/script>|<\/a>|<\/i>|<br ?\/?>|<\/select>)(\r\n)?/ig,"$1\r\n")
- //小段落添加回车换行
- .replace(/[\r\n ]* *<h1[^>]+>[\r\n]* *(第.{1,9}[章节])[ ]*([^ ]+)? *<\/h1>/ig,"\r\n<h1>$1 $2</h1>\r\n")
- //缩短<h1>标签
- .replace(/(\">)(( | | )*[…\.]+[\r\n]+)?( | | )*PS:(.*<br ?\/?>[\r\n]*)(?!<br ?\/?>)/ig,"$1\r\n")
- //删除章节头部的PS:行内容
- .replace(/ | /g," ")
- //替换字符串
- .replace(/([男女兽猎夫妇那])\*+([叫喊哭])/g,"$1人大$2")
- .replace(/\*+不离十/g,"八九不离十")
- .replace(/十有\*?\*/g,"十有八九")
- .replace(/天\*+美/g,"天性爱美")
- .replace(/洞\*+出/g,"洞内射出")
- .replace(/向\*+围/g,"向中心围")
- .replace(/消\*+影/g,"消失身影")
- .replace(/水\*+融/g,"水乳交融")
- //修正*内容
-
- .replace(/(<br ?\/?>[\r\n]*)\1( | | )*PS[::](.*<br ?\/?>[\r\n]*){1,5}/ig,"$1")
- //删除章节尾部PS:内容1-5行
- .replace(/( )*广大书友通知想看最新.*无弹窗更新快手机站/g,"")
- .replace(/ *.*第一时间看正版内容!/g,"");
- //删除广告内容行
- s = "";
- re = /(<p>|<h1> ?| +| +)(.+)(<br ?\/?>|<\/p>|<\/h1>)/ig;
- //提取<h1>到</h1>、<p>到</p>、空格到<br>或<br />或<br/>之间的内容
- while ((ar = re.exec(txt)) != null) {
- s += ar[2] + "\r\n\r\n";
- };
- fso.OpenTextFile(f + ".txt" ,2, true).Write(s);//保存到提取文件
- }
复制代码 发现这论坛也屏蔽这类,删除了,比如感情*彩,开口*流,灵兽*易,高大*力……都是**若的祸 |