执行子程序执行选项出错:子程序(执行选项)返回中止。运行子程序(内容发送)失败。解析表达式出错。
内部错误:子程序(内容发送_操作类片段_文件与图片)返回中止。文件不存在:(读取文件)
原始表达式:
// 确保输入文本 line break 为 LF
var rxOperation = new Regex(@"
(?>\n?)(?<fileIMG>^)\[(?>img|file)]\([^\r\n]+\)$ | #文件与图片
(?>\n?)(?<richFormat>^)```(?>HTML_Format|
Markdown_Format|
Plain_Format|
WeChat_RichEdit_Format|
QQ_Unicode_RichEdit_Format|
QQ_RichEdit_Format|
Quicker_Action_Steps)\n
.+?^```$\n? | #富文本
(?>\n?)(?<sendKeys>^)~~~(?>[\x20\^+%`(){}0-9a-zA-Z]+)$ | #发送按键
(?>\n?)(?<multiInput>^)```Multi_Input\n.+?^```$ | #多步骤输入
(?>\n?)(?<expression>\{\{[^\n]+}}$) #独行的表达式
",
RegexOptions.Singleline |
RegexOptions.Multiline |
RegexOptions.IgnorePatternWhitespace);
var sendingContext = {sendingText}.Replace("\r\n", "\n");
var workingDir = {workDir};
int lastIndex = 0;
var m = rxOperation.Match(sendingContext);
//发送 pre , 执行 m.Value
while(m.Success){
var pre = sendingContext.Substring(lastIndex, m.Index - lastIndex);
if(!String.IsNullOrEmpty(pre))
_context.RunSp("内容发送_文本类片段", new {input = pre});
if(m.Groups["fileIMG"].Success)
_context.RunSp("内容发送_操作类片段_文件与图片", new {input = m.Value, dir = workingDir});
if(m.Groups["richFormat"].Success)
_context.RunSp("内容发送_操作类片段_富文本", new {input = m.Value});
if(m.Groups["sendKeys"].Success)
_context.RunSp("内容发送_操作类片段_发送按键", new {input = m.Value});
if(m.Groups["multiInput"].Success)
_context.RunSp("内容发送_操作类片段_多步骤输入", new {input = m.Value});
if(m.Groups["expression"].Success)
_context.RunSp("内容发送_文本类片段", new {input = m.Value});
lastIndex = m.Index + m.Length;
m = m.NextMatch();
}
// 发送尾部文本片段
if(lastIndex < sendingContext.Length)
_context.RunSp("内容发送_文本类片段", new {input = sendingContext.Substring(lastIndex)});
return lastIndex;
(赋值)(运行子程序)。
你是怎么写的,我这样测试没问题。
多文件
[file](C:\Users\76734\Downloads\aaa.html)
[file](C:\Users\76734\Downloads\bbb.md)