以下の例では、文字列内のすべての HotelNames を取得するために VB.NET を使用しようとしています。
これが私のコードです:
Dim thepage As String = postreqreader.ReadToEnd
Dim r As New Regex("""HotelName"":"".*""")
Dim matches As MatchCollection = r.Matches(thepage)
For Each hotelname As Match In matches
ListBox1.Items.Add(hotelname.Value.Split("""").GetValue(3))
Next
ただし、これは最初の HotelName を ListBox に追加するだけです。各 HotelName の一致をリストボックスに入れる方法はありますか? 御時間ありがとうございます!
短縮文字列:
"HotelName":"ホームウッド スイーツ バイ ヒルトン ダラス - アーリントン","HotelNameShort":"ホームウッド スイーツ バイ ヒルトン...","HotelNameShortAvailabilityRecommendations":"ホームウッド スイーツ バイ H...","HotelName":"ナイツ イン アーリントン","HotelNameShort":"Knights Inn Arlington","HotelNameShortAvailabilityRecommendations":"Knights Inn Arlingto...","HotelName":"Howard Johnson Express Inn - Arlington Ballpark / Six Flags","HotelNameShort":"Howard Johnson Express In...","HotelNameShortAvailabilityRecommendations":"ハワード ジョンソン エクスプレス...","HotelName":"スーパー 8 アーリントン/SW","HotelNameShort":"スーパー 8 アーリントン/SW","HotelNameShortAvailabilityRecommendations":"スーパー 8 アーリントン/サウスウェスト...",