13559019013 发表于 2019-12-14 17:50

易语言取文本内容




{"appkey":"cntaobao","display":"名字","nick":"名字","portrait":"pic:impicture|?filepath=resdb%3A%2F%2F0%2Ftrader%5Ccontactlist%5Cdefportrait_raw","status":-1,"unreadnum":0},"msgbody":"[{\"type\":0,\"value\":\"在吗\",\"jvale\":\"null\"}]","msgid":"6052659604801956621","msgstatus":0,"msgtime":"1574410899012","msgtype":0,"readflag":1,"svrtime":"1574410899012","toid":{"appkey":"cntaobao","display":"大乔","nick":"大乔","portrait":"pic:impicture|?filepath=D%3A%5CAliWorkbenchData%5CSystem%5Ccust_portrait_new%5C29%5Ccntaobao%E8%B5%A4%E9%80%94%E8%B1%B9%E6%97%97%E8%88%B0%E5%BA%97%3D%E5%A4%A7%E4%B9%94_raw","status":-1,"unreadnum":0}},{"cid":{"appkey":"cntaobao","display":"名字45749259","nick":"名字45749259","portrait":"pic:impicture|?filepath=resdb%3A%2F%2F0%2Ftrader%5Ccontactlist%5Cdefportrait_raw","status":-1,"unreadnum":0},"extinfo":{"autochatmsg":0,"fixmsgread":0,"others":{"gws_msg_content_type":"0","msg_feature":"1","nickname":"{\"user\":{\"cntaobao名字45749259\":\"名字45749259\",\"cntaobao大乔\":\"大乔\"},\"tribe\":{}}"},"syschatmsg":0},"fromid":{"appkey":"cntaobao","display":"大乔","nick":"大乔","portrait":"pic:impicture|?filepath=D%3A%5CAliWorkbenchData%5CSystem%5Ccust_portrait_new%5C29%5Ccntaobao%E8%B5%A4%E9%80%94%E8%B1%B9%E6%97%97%E8%88%B0%E5%BA%97%3D%E5%A4%A7%E4%B9%94_raw","status":-1,"unreadnum":0},"msgbody":"[{\"type\":0,\"value\":\"亲 您好\",\"jvale\":\"{\\\"FONT_COLOR\\\":0,\\\"FONT_FAMILY\\\":\\\"微软雅黑\\\",\\\"FONT_SIZE\\




要怎么才从这么多内容中取出“在吗 ”和 ”亲 您好” 并且按顺序排列呢

求助大佬{:1_887:}

fiwk 发表于 2019-12-15 22:52

这个文本是json,至于什么是json,那就百度吧

l101 发表于 2019-12-21 14:10

用精益模块,这是代码,自己复制到易语言看看改改
这里的#常量1是你给出的文本

.版本 2

.子程序 测试001
.局部变量 文本, 文本型
.局部变量 文本数组, 文本型, , "0"
.局部变量 i

文本 = #常量1
文本_取中间_批量 (文本, “value\” + #引号 + “:\” + #引号, “\” + #引号 + “,\” + #引号, 文本数组)
.计次循环首 (取数组成员数 (文本数组), i)
    输出调试文本 (文本数组 )


.计次循环尾 ()

13559019013 发表于 2019-12-21 14:34

l101 发表于 2019-12-21 14:10
用精益模块,这是代码,自己复制到易语言看看改改
这里的#常量1是你给出的文本



还有一个问题就是 怎么后台模拟按键 不干扰其他使用    长按CTRL   

l101 发表于 2019-12-22 12:23

长按Ctrl键?(′・_・`)是组合键吗比如按Ctrl+A

eweffg 发表于 2019-12-23 15:52

正则
\"value\":\"(.*?)\",\"jvale
页: [1]
查看完整版本: 易语言取文本内容