I'm trying to extract a substring of an email document with a regular expression. I'm testing the regex online, and it works perfectly:
I have a function to check the regex on Google Apps Script and the same regex isn't working here.
var regex = new RegExp("Intrusion signature\(s\)\:\n\n(.*)");
var e = regex.exec(data);
Does anyone knows why is not working?

\n\nisn't truly capturing all the spacing present between your expression and the text you want to extract. Try using\s+instead.RegExpobject, backslashes must be escaped:var regex = new RegExp("Intrusion signature\\(s\\)\\:\\n\\n(.*)");