legado icon indicating copy to clipboard operation
legado copied to clipboard

Regex

Open unOmni opened this issue 1 year ago • 5 comments

确认 / Assignments

  • [X] 搜索现有issues,不存在相似或相关的issue / No similar or related issues
  • [X] 最新测试版依然存在此问题 / Latest beta app does not work
  • [X] 此问题和Xposed、Lsposed、Magisk、手机主题、浏览器插件等无关 / Make sure your machine is not touched by hook frameworks, plugins etc

问题描述 / Describe Bugs

Nothing much to describe, just wondering why the regex replacement doesn't work as intended.

复现步骤 / How to reproduce

Screenshot

确认 / Assignment

  • [X] 已经提交复现所需要的附加资料 / Submit additions related with bugs

其他信息 / Additions

Screenshot_20230623-195623_Legado

日志提交 / Relevant log output

java.lang.IllegalArgumentException: No capturing group in the pattern with the name 1:+Devil:devil at java.util.regex.Matcher.getMatchedGroupIndex(Matcher.java:1197) at java.util.regex.Matcher.group(Matcher.java:492) at java.util.regex.Matcher.appendEvaluated(Matcher.java:753) at java.util.regex.Matcher.appendReplacement(Matcher.java:717) at io.legado.app.utils.r0.invokeSuspend(SourceFile:69) at io.legado.app.utils.r0.invoke(SourceFile:2) at io.legado.app.utils.r0.invoke(SourceFile:1) at io.legado.app.help.coroutine.h.invokeSuspend(SourceFile:61) at o4.a.resumeWith(SourceFile:9) at kotlinx.coroutines.i0.run(SourceFile:128) at com.bumptech.glide.load.engine.a.run(SourceFile:194) at f6.k.run(SourceFile:3) at f6.b.run(SourceFile:99)

阅读版本 / Legado version

3.23.061622

Android版本 / Android version

11

机型 / Model

Galaxy m21

unOmni avatar Jun 24 '23 16:06 unOmni

What is the regular syntax of ${1:+Devil:devil}? Is there any documentation about it?

821938089 avatar Jun 24 '23 23:06 821938089

Here's a documentation I found https://www.regexbuddy.com/manual.html#insertreplaceconditional

unOmni avatar Jun 25 '23 08:06 unOmni

Regular expression engine do not support this feature

821938089 avatar Jun 25 '23 08:06 821938089

What does the engine support that could allow for replacement depending on the condition.

unOmni avatar Jun 25 '23 10:06 unOmni

document https://developer.android.com/reference/java/util/regex/Pattern

i think the answer is no

821938089 avatar Jun 25 '23 10:06 821938089

由于长期没有状态更新,该问题将于5天后自动关闭。如有需要可重新打开。

github-actions[bot] avatar Jul 26 '23 01:07 github-actions[bot]

Solved on discord

unOmni avatar Jul 27 '23 09:07 unOmni