const regex = /(?i).+FE00(.{20}).+/i;
// Alternative syntax using RegExp constructor
// const regex = new RegExp('(?i).+FE00(.{20}).+', 'i')
const str = `0x00FFFFFFFFFFFF000DAF21170000000005130103802716780A06359E56529829145054000000010101010101010101010101010101012F2640A060841A30302035007ED710000018000000FE004E3137334647452D4C32310A20000000FE00434D4F0A202020202020202020000000FE004E3137334647452D4C32310A2000C3`;
const subst = `\1`;
// The substituted value will be contained in the result variable
const result = str.replace(regex, subst);
console.log('Substitution result: ', 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 JavaScript, please visit: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions