Android 正则表达式模式 Incode UTF-8

2024-02-22

我正在 android 中尝试使用 matcher.group(1) 捕获 (.+?) 代码:

String html = doc.html().toString();

                    Pattern p = Pattern.compile("(?is)caption\"(?is):(?is)\"(.+?)\",(?is)\"",
                            Pattern.DOTALL);
                        Matcher m = p.matcher(html);
                        if (m.find()){
                            text_main = m.group(1);
                        }

但有时它不起作用。我认为这可能是由 incode 引起的。所以:

  1. 如果我认为是真的,我能为这个问题做什么?(为utf-8制作正则表达式)
  2. 如果我错了,那我该怎么办?我正在尝试获取 json 对象中的字符串。 json 代码放置在 html 页面的脚本中。

None

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Android 正则表达式模式 Incode UTF-8 的相关文章

随机推荐