|
|
|
@ -447,6 +447,10 @@ class AnalyzeRule(var book: BaseBook? = null) : JsExtensions { |
|
|
|
|
else -> rule = ruleStr |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (mode == Mode.Js) { |
|
|
|
|
ruleType.add(defaultRuleType) |
|
|
|
|
ruleParam.add(rule) |
|
|
|
|
} else { |
|
|
|
|
//分离put |
|
|
|
|
rule = splitPutRule(rule, putMap) |
|
|
|
|
//@get,{{ }}, 拆分 |
|
|
|
@ -456,7 +460,7 @@ class AnalyzeRule(var book: BaseBook? = null) : JsExtensions { |
|
|
|
|
while (evalMatcher.find()) { |
|
|
|
|
if (evalMatcher.start() > start) { |
|
|
|
|
tmp = rule.substring(start, evalMatcher.start()) |
|
|
|
|
if (start == 0 && !tmp.contains("##") && mode != Mode.Js) { |
|
|
|
|
if (start == 0 && !tmp.contains("##")) { |
|
|
|
|
mode = Mode.Regex |
|
|
|
|
} |
|
|
|
|
splitRegex(tmp) |
|
|
|
@ -482,6 +486,7 @@ class AnalyzeRule(var book: BaseBook? = null) : JsExtensions { |
|
|
|
|
splitRegex(tmp) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 拆分\$\d{1,2} |
|
|
|
@ -492,9 +497,7 @@ class AnalyzeRule(var book: BaseBook? = null) : JsExtensions { |
|
|
|
|
val ruleStrArray = ruleStr.split("##") |
|
|
|
|
val regexMatcher = regexPattern.matcher(ruleStrArray[0]) |
|
|
|
|
while (regexMatcher.find()) { |
|
|
|
|
if (mode != Mode.Js) { |
|
|
|
|
mode = Mode.Regex |
|
|
|
|
} |
|
|
|
|
if (regexMatcher.start() > start) { |
|
|
|
|
tmp = ruleStr.substring(start, regexMatcher.start()) |
|
|
|
|
ruleType.add(defaultRuleType) |
|
|
|
|