JSFiddle - React, Tailwind, and code Playground
JavaScript
str = "Hey I'm $$Zach$$";
str = str.replace(/\${2}(.*?)\${2}/g, "<I>$1</I>");
console.log(str);
str = "Hey I'm $$Zach$$";
str = str.replace(/\${2}(.*?)\${2}/g, "<I>$1</I>");
console.log(str);