use strict;
my $str = '0x00FFFFFFFFFFFF000DAF21170000000005130103802716780A06359E56529829145054000000010101010101010101010101010101012F2640A060841A30302035007ED710000018000000FE004E3137334647452D4C32310A20000000FE00434D4F0A202020202020202020000000FE004E3137334647452D4C32310A2000C3';
my $regex = qr/(?i).+FE00(.{20}).+/ip;
my $subst = '\\1';
my $result = $str =~ s/$regex/$subst/r;
print "The result of the substitution is' $result\n";
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 Perl, please visit: http://perldoc.perl.org/perlre.html