解析后得到文本:
var User = new CUser({id: 0, login: 'anonymous'});
var Book = new CBook({
id: 14470,
owner_id: 129537,
facecontrol: 1,
s_lang: 2,
t_lang: 1,
n_verses: 150,
n_vars: 150,
d_vars: 150,
typ: 'A',
s_title: 'Title',
t_title: 'Название',
});
如何解析它以获取 s_title、t_title 等?我看到了正则表达式的选项,但什么也没发生。
for(script in scripts){
if (script.data().contains("s_title")){
val p: Pattern = Pattern.compile("(?is)t_title=\"(.+?)\"") // Regex for the value of the key
val m: Matcher = p.matcher(script.html())
while( m.find() )
{
Log.i("ParserShell", "${m.group()} = ${m.group(1)}")
}
}
}
该怎么办?
而不是 s_title,指定您需要获取的内容