I want to replace/delete any text (also with line breaks) that is between 2 javascript comments, but the forward-slashes make me headache.
What I have at the moment, but is not working:
var text="//beginTESTTESTTEST//end";
var regex = "/\//begin+(.)+\//end*/g";
console.log(text.replace(regex,""));
Expected output would be
"//begin//end"
Thank you
str.replace(/(\/{2}begin)[^]*?(\/{2}end\b)/g, '$1$2');