|
|
@ -343,7 +343,7 @@ class AnalyzeRule(var book: BaseBook? = null) : JsExtensions { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
evalMatcher.appendTail(stringBuffer) |
|
|
|
evalMatcher.appendTail(stringBuffer) |
|
|
|
val replaceRegex = stringBuffer.toString() |
|
|
|
val replaceRegex = Pattern.quote(stringBuffer.toString()) |
|
|
|
if (replaceRegex.isNotEmpty()) { |
|
|
|
if (replaceRegex.isNotEmpty()) { |
|
|
|
vResult = if (rule.replaceFirst) { |
|
|
|
vResult = if (rule.replaceFirst) { |
|
|
|
val pattern = Pattern.compile(replaceRegex) |
|
|
|
val pattern = Pattern.compile(replaceRegex) |
|
|
@ -466,15 +466,8 @@ class AnalyzeRule(var book: BaseBook? = null) : JsExtensions { |
|
|
|
//分离put |
|
|
|
//分离put |
|
|
|
rule = splitPutRule(rule, putMap) |
|
|
|
rule = splitPutRule(rule, putMap) |
|
|
|
//分离正则表达式 |
|
|
|
//分离正则表达式 |
|
|
|
val index = rule.indexOf("}}") |
|
|
|
val ruleStrS = rule.trim { it <= ' ' }.split("##") |
|
|
|
var rule1 = "" |
|
|
|
rule = ruleStrS[0] |
|
|
|
var rule2 = rule |
|
|
|
|
|
|
|
if (index > 0) { |
|
|
|
|
|
|
|
rule1 = rule.substring(0, index) |
|
|
|
|
|
|
|
rule2 = rule.substring(index) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
val ruleStrS = rule2.trim { it <= ' ' }.split("##") |
|
|
|
|
|
|
|
rule = rule1 + ruleStrS[0] |
|
|
|
|
|
|
|
if (ruleStrS.size > 1) { |
|
|
|
if (ruleStrS.size > 1) { |
|
|
|
replaceRegex = ruleStrS[1] |
|
|
|
replaceRegex = ruleStrS[1] |
|
|
|
} |
|
|
|
} |
|
|
|