From 35c9a139b19fa7ab8ab320a1d492217e5198aa64 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 6 Nov 2019 16:00:49 +0800 Subject: [PATCH] up --- .../io/legado/app/model/analyzeRule/AnalyzeRule.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt index b3afc5069..336e09a13 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt @@ -436,8 +436,15 @@ class AnalyzeRule(private var book: BaseBook? = null) { //分离put rule = splitPutRule(rule, putMap) //分离正则表达式 - val ruleStrS = rule.trim { it <= ' ' }.split("##") - rule = ruleStrS[0] + val index = rule.indexOf("}}") + var rule1 = "" + 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) { replaceRegex = ruleStrS[1] }