gpt4 book ai didi

java - 解析JSON JAVA中的复杂字符串

转载 作者:行者123 更新时间:2023-11-29 07:53:24 24 4
gpt4 key购买 nike

<分区>

我有一个非常复杂的字符串,如下所示,

"data":"[
{
"id": "123456",
"from":
{
"name": "ABC",
"id": "123"
},

"message": "isafh",
"story": "Best Story",
"properties":
[
{
"name": "By",
"text": "PROUD TO BE AN INDIAN",
"href": "www.xyz.com"
}
],
"privacy":
{
"value": ""
},
"type": "photo",
"created_time": "2013-10-24T07:17:28+0000",
"updated_time": "2013-10-24T07:17:28+0000"
},
{
"id": "122423456",
"from":
{
"name": "ABCaasd",
"id": "124233"
},

"message": "isafh",
"story": "Best nice Story",
"properties":
[
{
"name": "By",
"text": "PROUD TO BE AN INDIAN",
"href": "www.abc.com"
}
],
"privacy":
{
"value": ""
},
"type": "photo",
"created_time": "2013-10-24T07:17:28+0000",
},
{
Similar data as above {... }
},
]"
"next token":"1233"

这里所有的 JSON 数据都在这些括号“[]”中,这些括号由“{ ... }”分隔,大括号。这里我想要所有花括号中的消息、故事和属性。尝试了两件事,一个是两个,将所有内容再次放入 JSON 对象中,还尝试了无用的尝试来匹配正则表达式“消息:”,但即使这样也没有用。

从所有大括号中找到消息、故事和属性的方法是什么。

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com