找回密码
 立即注册
搜索
查看: 2046|回复: 1
打印 上一主题 下一主题
收起左侧

[求助] EmEditor宏--中华太阳系联盟版 脚本问题!【已解决】

[复制链接]
跳转到指定楼层
楼主
发表于 2013-2-4 00:08 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
今天发现EmEditor宏--中华太阳系联盟版的 标题前后插入半角空格(第一章) → ( 第一章 )只能处理999章,

case 117: //标题章节前后插入一个半角空格
        var title=prompt("请输入标题的表达式或(.*关键词.*)(可修改默认标题表达式)","第[0-9一二三四五六七八九十两百零〇]{1,5}[册集部卷章节回]")
        if (title!="")
        {
            document.selection.Replace("("+title+")"," \\1 ",nFlags);
            document.selection.Replace("[ ]+("+title+")[ ]+"," \\1 ",nFlags);
            document.selection.Replace("^[ ]+","",nFlags);
        }
        break;

标题前插入二三个空行也只能处理999章。

case 132:///标题前插入三个空行
        var title=prompt("输入标题表达式或关键词,已含“作品相关”等标题。","第[0-9一二三四五六七八九十两百零〇]{1,5}[册集部卷章节回]")
        if (title!="")
        {
            bAnswer = confirm("按确定插入三个空行,按取消只插入两个空行。");
        if (bAnswer==true)
            {
            document.selection.Replace("^([^  ]*"+title+")","\\n\\n\\n\\1",nFlags);
            document.selection.Replace("^[  ]+([^  ]*"+title+")","\\n\\n\\n\\1",nFlags);
            document.selection.Replace("^[  ]*正文","\\n\\n\\n正文",nFlags);
            document.selection.Replace("^[  ]*作品相关","\\n\\n\\n作品相关",nFlags);
            document.selection.Replace("^[  ]*序","\\n\\n\\n序",nFlags);
            document.selection.Replace("^[  ]*前言","\\n\\n\\n前言",nFlags);
            document.selection.Replace("^[  ]*后记","\\n\\n\\n后记",nFlags);
            document.selection.Replace("^[  ]*引子","\\n\\n\\n引子",nFlags);
            document.selection.Replace("^[  ]*楔","\\n\\n\\n楔",nFlags);
            }
        else
            {
            document.selection.Replace("^([^  ]*"+title+")","\\n\\n\\1",nFlags);
            document.selection.Replace("^[  ]+([^  ]*"+title+")","\\n\\n\\1",nFlags);
            document.selection.Replace("^[  ]*正文","\\n\\n正文",nFlags);
            document.selection.Replace("^[  ]*作品相关","\\n\\n作品相关",nFlags);
            document.selection.Replace("^[  ]*序","\\n\\n序",nFlags);
            document.selection.Replace("^[  ]*引子","\\n\\n引子",nFlags);
            document.selection.Replace("^[  ]*前言","\\n\\n前言",nFlags);
            document.selection.Replace("^[  ]*后记","\\n\\n后记",nFlags);
            document.selection.Replace("^[  ]*楔","\\n\\n楔",nFlags);
            }
        }
        break;

请问怎么修改才能处理几千章?
插件设计:zasq.net

青铜会员 - 等级≥州判

灰铜v1_02蓝铜v2_01绿铜v3_01

沙发
发表于 2013-2-4 00:25 | 只看该作者
第[0-9一二三四五六七八九十两百零〇]{1,5}[册集部卷章节回]
改成
第[0-9一二三四五六七八九十两百零〇千]{1,7}[册集部卷章节回]
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋| ( Q群816270601 )

GMT+8, 2024-4-28 05:18 , Processed in 1.348383 second(s), 48 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表