Here is a RegExp expression that I am currently using:
const regex = new RegExp('<(.*)>' + text + '<(.*)>');
renderer.setProperty(node, 'innerHTML', node.innerHTML.replace(regex, '<$1>' + replaceText + '<$2>'));
Instead of using '<$1>'
and '<$2>'
, I would like to use '<$open>'
and '<$close>'
Unfortunately, when I tried changing it, it did not work as expected.
Does anyone know how I can achieve this?