$re = '/(?i).+FE00(.{20}).+/i';
$str = '0x00FFFFFFFFFFFF000DAF21170000000005130103802716780A06359E56529829145054000000010101010101010101010101010101012F2640A060841A30302035007ED710000018000000FE004E3137334647452D4C32310A20000000FE00434D4F0A202020202020202020000000FE004E3137334647452D4C32310A2000C3';
$subst = "\1";
$result = preg_replace($re, $subst, $str, 1);
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