I've been beating my head on this one, and can't figure out a regexp to accomplish the following:
Input string (this is JSON data surrounded by lots of other JSON):
$string=..."natural_order":"12"...
where 12 could also be a decimal like "1.2", or could be larger like 1288 or 1.288.
Desired string:
..."natural_order":12...
Using php preg_replace, so far I've gotten:
preg_replace('/[^natural_order:]+"/', '', $string);
but only returns:
"12"
Any thoughts are greatly appreciated!
preg_replaceis for modifying the target string. To extract something you would needpreg_match. stackoverflow.com/questions/5762739/…