I'm trying to use regular expressions to extract a certain value from a string:
"exec_hash": "/TPPE2ChB+5HuSHs84FBgx5/EgWi0OlaEXoXq4pq3Aukhc1Ypf0mZfKCJ10w=", "events_collector": "thiiM0ahsieSiech1phithe6chahngoo8sah6aid "
The data I want is the hash between the quotation marks. The problem is that there are multiple quotes within the string and preg_match_all
function isn't returning the correct data. I've been playing around with regex for a while but can't figure it out. Ultimately, I'd like that data to be returned into a value. Ex: $string1 = '/TPPE2ChB+5HuSHs84FBgx5/EgWi0OlaEXoXq4pq3Aukhc1Ypf0mZfKCJ10w=';
Correction: I'm using curl to grab the page content. The data isn't stored in a variable.
$matches = array(); $thing = preg_match_all('/hash": "(.*?)", "events/',$page,$matches); print_r($matches);
It spits out a long array of much more than just the hash