I have a file in this format:
5:Name: {"hash":"c602720140e907d715a9b90da493036f","start":"2016-02-20","end":"2016-03-04"} 5:Name: {"hash":"e319b125d71c62ffd3714b9b679d0624","sa_forum":"on","start":"2015-11-14","end":"2016-02-20"} I am trying to extract the hash key and date using a regular expression. How can I do it?
I tried this /^[a-z0-9]{32}$/ for the hash but it doesn't work.
I would appreciate some help.
Edit: This is a text file, and I'm trying to preg_match() it. Here's my code:
$file = file_get_contents("log.txt"); preg_match("/^[a-z0-9]{32}$/",$file, $hashes); var_dump($hashes); I get an empty array.
json_deocde($string,true);