$re = '/^.*_(.*)\.txt$/m';
$str = 'UNKNOWN_{_requestID___b9b6bcc4-c163-45d7-82d9-423a96cf5fe1_,_deviceID___9c84f871-9e95-45d5-9335-12e7d42b96a0_}_2018-08-15-15-43-01-296_529307b7-6316-4cdc-ab53-2e1158c651c6.txt';
$subst = "\1";
$result = preg_replace($re, $subst, $str);
echo "The result of the substitution is ".$result;
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