diff --git a/app/src/main/java/io/legado/app/model/localBook/TextFile.kt b/app/src/main/java/io/legado/app/model/localBook/TextFile.kt index bf759fb28..f49254ff9 100644 --- a/app/src/main/java/io/legado/app/model/localBook/TextFile.kt +++ b/app/src/main/java/io/legado/app/model/localBook/TextFile.kt @@ -323,7 +323,7 @@ class TextFile(private val book: Book) { val list = arrayListOf() var maxCs = 1 for (tocRule in rules) { - val pattern = Pattern.compile(tocRule.rule, Pattern.MULTILINE) + val pattern = tocRule.rule.toPattern(Pattern.MULTILINE) val matcher = pattern.matcher(content) var cs = 0 while (matcher.find()) {