$re = '/"(.+?)".+?/m';
$str = '{
"timelineObjects" : [ {
"activitySegment" : {
"startLocation" : {
"latitudeE7" : 84876125,
"longitudeE7" : 986251728
},
"endLocation" : {
"latitudeE7" : 81501293,
"longitudeE7" : 988554012
},
"duration" : {
"startTimestampMs" : "1577853940096",
"endTimestampMs" : "1577867160036"
},
"distance" : 45275,
"activityType" : "IN_PASSENGER_VEHICLE",
"confidence" : "HIGH",
"activities" : [ {
"activityType" : "IN_PASSENGER_VEHICLE",
"probability" : 78.98348569869995
}, {
"activityType" : "STILL",
"probability" : 13.971047103404999
}, {
"activityType" : "MOTORCYCLING",
"probability" : 3.0464861541986465
}, {
"activityType" : "WALKING",
"probability" : 2.5266656652092934
}, {
"activityType" : "IN_FERRY",
"probability" : 0.7077858783304691
}, {
"activityType" : "CYCLING",
"probability" : 0.23177380207926035
}, {
"activityType" : "FLYING",
"probability" : 0.2262754598632455
}, {
"activityType" : "IN_BUS",
"probability" : 0.1849415129981935
}, {
"activityType" : "RUNNING",
"probability" : 0.0680008321069181
}, {
"activityType" : "SAILING",
"probability" : 0.029427077970467508
}, {
"activityType" : "SKIING",
"probability" : 0.015666104445699602
}, {
"activityType" : "IN_TRAIN",
"probability" : 0.006996936281211674
}, {
"activityType" : "IN_SUBWAY",
"probability" : 0.0010493132322153542
}, {
"activityType" : "IN_TRAM",
"probability" : 3.152051021970692E-4
}, {
"activityType" : "IN_VEHICLE",
"probability" : 8.468594501209736E-5
} ],
"simplifiedRawPath" : {
"points" : [ {
"latE7" : 81042775,
"lngE7" : 989657755,
"timestampMs" : "1577867101472",
"accuracyMeters" : 122
} ]
}
}
}, {
"placeVisit" : {
"location" : {
"latitudeE7" : 81037885,
"longitudeE7" : 989663263,
"placeId" : "ChIJrX3SBcuTUTAR4r4hEgpoSvA",
"address" : "313 หมู่ 12 อำเภอ เมือง\\nตำบล กระบี่น้อย อำเภอเมืองกระบี่\\nกระบี่ 81000\\nThailand",
"name" : "สำนักงานทางหลวงที่ 17",
"sourceInfo" : {
"deviceTag" : -1189270403
},
"locationConfidence" : 63.438793
},
"duration" : {
"startTimestampMs" : "1577867160036",
"endTimestampMs" : "1577873822494"
},
"placeConfidence" : "MEDIUM_CONFIDENCE",
"centerLatE7" : 81042540,
"centerLngE7" : 989657723,
"visitConfidence" : 91,
"otherCandidateLocations" : [ {
"latitudeE7" : 81035660,
"longitudeE7" : 989642884,
"placeId" : "ChIJmfJgxcuTUTAR-VQR_9hOeGk",
"locationConfidence" : 21.532362
}
}
} ]
}';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php