I have found a short script which finds a line with a certain phrase in it and replaces the whole line with a new line. However I can't work out how to include a variable where it says '#RemoveMe' in the str.replace. (I want to include the variable 'start' which is passed in by the function's trigger, to make --> (/^.start.$/mg, ""))
Any help appreciated...
var str = 'line1\n'+ 'line2\n'+ '#RemoveMe line3\n'+ 'line4'; var test = str.replace(/^.*#RemoveMe.*$/mg, "");