- var_dump: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$re = '/:"\K[a-f\d]{32}(?=")/';
$str = 'pagination},queryId:"472f257a40c653c64c666ce877d59d2b", val:"598f257a40c653c64c666ce877d59d2b"';
preg_match_all($re, $str, $matches);
var_dump($matches);