如何把用正则从网页匹配到字符串转换为包含数组的对象?

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: 如何把用正则从网页匹配到字符串转换为包含数组的对象?

Re: 如何把用正则从网页匹配到字符串转换为包含数组的对象?

Post by xcracked » 09 Dec 2018, 05:37

tmplinshi wrote:
26 Nov 2018, 23:31
那个是 JSON 数据。可以用 Jxon 转换成 AHK 对象。
谢谢!

Re: 如何把用正则从网页匹配到字符串转换为包含数组的对象?

Post by tmplinshi » 26 Nov 2018, 23:31

那个是 JSON 数据。可以用 Jxon 转换成 AHK 对象。

如何把用正则从网页匹配到字符串转换为包含数组的对象?

Post by xcracked » 26 Nov 2018, 21:19

请问:我用WinHttp.Request的GET方法获取了一个网页内容,里面有一个标签的内容有我想要的信息,格式为[{"keya":valuea,"keyb":valueb},{"keyc":valuec,"keyd":valued},{"keye":valuee,"keyf":valuef},{"keyg":valueg,"keyh":valueh}]。现在我用正则把它匹配出来了,但是是一个字符串,不能用AHK访问数组对象的方法来访问内容,有什么办法能把它转换为可以直接访问的对象吗?或者可以直接从网页直接获取的就是可以访问的对象?谢谢!

Top