出力の形式は[{uuid, Readings}, {uuid, Readings}, {uuid,Readings}]
(通常これより長い)
たとえば...(すべて1つの文字列で、見やすいようにフォーマットされています)。
[{"uuid": "e2e38e4e-431d-508a-a5f9-e50eaffe6aab", "Readings": [[1351329301000.0, 0.0], [1351330202000.0, 0.0], [1351331102000.0, 0.0]]},
{"uuid": "8ed157d9-b31d-5075-bad6-69dfde7a34a4", "Readings": [[1351329301000.0, 0.0], [1351330202000.0, 0.0], [1351411200000.0, 494.0]]},
{"uuid": "8737f287-14df-5ccd-82df-e66ca7374b63", "Readings": [[1351329300000.0, 515.0], [1351330200000.0, 467.0], ]}]
これを解析して、「{}」記号を含む「{}」記号の間にあるすべてのものを取得したいと思います。
私は他に何も分離したくありません。'{}'記号の間にあるものはすべて、1つの文字列として一緒に保持する必要があります。
私も興味があるのは、最後に各結果の周りに「[]」を追加することです。
簡単な例:
[ {"uuid": 1, "Readings": [[2,3], [2,6]]}, {"uuid": 1, "Readings": [[5,6], [7,7]]} ]
配列は次のようになります
element 0 = "[{"uuid": 1, "Readings": [[2,3], [2,6]]}]"
element 1 = "[{"uuid": 1, "Readings": [[5,6], [7,7]]}]"
このようなものを選択するための正規表現を知っている人はいますか?(私はレールにルビーを使用しています)