pull/2457/head
kunfei 2 years ago
parent 94287b106a
commit a3a3c53199
  1. 3
      app/src/main/java/io/legado/app/utils/RegexExtensions.kt

@ -5,7 +5,8 @@ import com.script.SimpleBindings
import io.legado.app.constant.AppConst import io.legado.app.constant.AppConst
/** /**
* 带有超时检测的正则替换 * 带有js功能的正则替换
* 采用com.google.re2j.Pattern,不会导致无限执行
*/ */
fun CharSequence.replaceRegex(regex: String, replacement: String): Result<String> { fun CharSequence.replaceRegex(regex: String, replacement: String): Result<String> {
return kotlin.runCatching { return kotlin.runCatching {

Loading…
Cancel
Save