$re = '/\"status\":(?<status>[^\}])\",\"requestId\":/m';
$str = '{"level":"debug","message":"handler result : {\\"body\\":\\"{\\\\\\"numberOfProcessedRecords\\\\\\":1}\\",\\"status\\":201}","requestId":"ecd06f97-975b-5faf-81a0-3431fb4d1070"}';
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