So in my code
body.replaceText("test1","test2");
works and so do simple regexs, but I can't get more complex ones to work. For example I want to remove all spacing between two tags and replace it with three carriage returns. I've tested it out in regexr and other tools and it works but it does nothing in my Apps Script.
body.replaceText("/</em>[\r\n]+<strong>/g","</em>\r\r\r<strong>");
this doesn't work either
body.replaceText("</em>[\r\n]+<strong>","</em>\r\r\r<strong>");