From 0bd37974a24696c8852c19dcefeeedcb3a046cad Mon Sep 17 00:00:00 2001 From: YouWei Zhao Date: Tue, 19 May 2020 17:12:01 +0800 Subject: [PATCH] fix regexp format for moblie --- _server/MotaActionParse.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_server/MotaActionParse.js b/_server/MotaActionParse.js index 5654bd52..1ad9682a 100644 --- a/_server/MotaActionParse.js +++ b/_server/MotaActionParse.js @@ -1022,9 +1022,9 @@ ActionParser.prototype.matchEvalCompare=function(args, isShadow){ // 按优先级依次寻找以下符号 var oplist=['<','<=','>','>=','==','!=','&&','||'].reverse() for (var index = 0,op; op=oplist[index]; index++) { - var match=new RegExp('(?<= )'+(op=='||'?'\\|\\|':op)+'(?= )').exec(str) + var match=new RegExp(' '+(op=='||'?'\\|\\|':op)+' ').exec(str) if (!match) continue; - args=[this.expandEvalBlock([raw.slice(0,match.index)],isShadow),op.replace(/&/g,'&').replace(//g,'>'),this.expandEvalBlock([raw.slice(match.index+op.length)],isShadow)] + args=[this.expandEvalBlock([raw.slice(0,match.index+1)],isShadow),op.replace(/&/g,'&').replace(//g,'>'),this.expandEvalBlock([raw.slice(match.index+1+op.length)],isShadow)] return {ret:true,xml:xml,args:args} } return {ret:false}