将“[^"]*”之后的正则更改为"开头,避免出现前面的正则抢占后面正则匹配的序列,导致带参数的图片“捕获分组1”得到的链接不包含全部参数的问题。
pull/1171/head
bushixuanqi 3 years ago committed by GitHub
parent 1035ae090f
commit 388d29f445
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/src/main/java/io/legado/app/constant/AppPattern.kt

@ -9,7 +9,7 @@ object AppPattern {
val EXP_PATTERN: Pattern = Pattern.compile("\\{\\{([\\w\\W]*?)\\}\\}")
//匹配格式化后的图片格式
val imgPattern: Pattern = Pattern.compile("<img[^>]*src=\"([^\"]*(?:,\\{[^>]+\\})?)\"[^>]*>")
val imgPattern: Pattern = Pattern.compile("<img[^>]*src=\"([^\"]*(?:\"[^>]+\\})?)\"[^>]*>")
val nameRegex = Regex("\\s+作\\s*者.*|\\s+\\S+\\s+著")
val authorRegex = Regex("^.*?作\\s*者[::\\s]*|\\s+著")

Loading…
Cancel
Save