道歉,如果主題標題不準確,我真的不知道如何表達它(沒有雙關語意圖)。 我必須用類似於下面的結構來解析JSON。在這個文件中有幾個Date數組:每個數組都以yyyy-MM-dd的形式命名,但是我不知道文件中的具體日期(所以我不能提取數組其名稱)。我還能怎樣得到它? 我正在使用json.simple for Java解析文件。我不指望一個答案,告訴我如何使用該庫專門做它,但如果有人知道,這將是一個獎金:)JSON解析時名稱是正則表達式(日期)
"2011-05-15":[
{
"promoted_content":null,
"events":null,
"query":"AnahiHappyBDay",
"name":"AnahiHappyBDay"
},
{
"promoted_content":null,
"events":null,
"query":"Puerto Ricans",
"name":"Puerto Ricans"
},
{
"promoted_content":null,
"events":null,
"query":"Epic Movie",
"name":"Epic Movie"
},
{
"promoted_content":null,
"events":null,
"query":"Lee Soonkyu",
"name":"Lee Soonkyu"
},
{
"promoted_content":null,
"events":null,
"query":"MC1123",
"name":"MC1123"
},
{
"promoted_content":null,
"events":null,
"query":"Dominique Strauss-Kahn",
"name":"Dominique Strauss-Kahn"
},
{
"promoted_content":null,
"events":null,
"query":"WeLoveNickJonas",
"name":"WeLoveNickJonas"
},
{
"promoted_content":null,
"events":null,
"query":"Ripper Stefan",
"name":"Ripper Stefan"
},
{
"promoted_content":null,
"events":null,
"query":"Luc\u00eda P\u00e9rez",
"name":"Luc\u00eda P\u00e9rez"
},
{
"promoted_content":null,
"events":null,
"query":"DB5K",
"name":"DB5K"
},
{
"promoted_content":null,
"events":null,
"query":"WeSupportYouGomez",
"name":"WeSupportYouGomez"
},
{
"promoted_content":null,
"events":null,
"query":"LSnoAltasHoras",
"name":"LSnoAltasHoras"
},
{
"promoted_content":null,
"events":null,
"query":"Azerbaijan",
"name":"Azerbaijan"
},
{
"promoted_content":null,
"events":null,
"query":"Eurovision",
"name":"Eurovision"
},
{
"promoted_content":null,
"events":null,
"query":"Derek Boogaard",
"name":"Derek Boogaard"
},
{
"promoted_content":null,
"events":null,
"query":"Terry Wogan",
"name":"Terry Wogan"
},
{
"promoted_content":null,
"events":null,
"query":"FMI",
"name":"FMI"
},
{
"promoted_content":null,
"events":null,
"query":"WorldLovesSwift",
"name":"WorldLovesSwift"
},
{
"promoted_content":null,
"events":null,
"query":"WorldWarIV",
"name":"WorldWarIV"
},
{
"promoted_content":null,
"events":null,
"query":"Jedward",
"name":"Jedward"
},
{
"promoted_content":null,
"events":null,
"query":"GAGA10MILLION",
"name":"GAGA10MILLION"
},
{
"promoted_content":null,
"events":null,
"query":"Stefan Raab",
"name":"Stefan Raab"
},
{
"promoted_content":null,
"events":null,
"query":"Manchester United Campe\u00f3n",
"name":"Manchester United Campe\u00f3n"
},
{
"promoted_content":null,
"events":null,
"query":"Derek Mooney",
"name":"Derek Mooney"
},
{
"promoted_content":null,
"events":null,
"query":"Chord Overstreet",
"name":"Chord Overstreet"
},
{
"promoted_content":null,
"events":null,
"query":"IMF",
"name":"IMF"
},
{
"promoted_content":null,
"events":null,
"query":"Joe Buck",
"name":"Joe Buck"
},
{
"promoted_content":null,
"events":null,
"query":"\u0410\u0437\u0435\u0440\u0431\u0430\u0439\u0434\u0436\u0430\u043d",
"name":"\u0410\u0437\u0435\u0440\u0431\u0430\u0439\u0434\u0436\u0430\u043d"
},
{
"promoted_content":null,
"events":null,
"query":"Wango Tango",
"name":"Wango Tango"
},
{
"promoted_content":null,
"events":null,
"query":"AlwaysRihannaNavy",
"name":"AlwaysRihannaNavy"
}
],
>我還能怎麼得到它?我不明白。你是說你在一個文件中有多個json,你想要處理每個? – 2011-05-19 14:05:55