I need a regex in javascript, that replaces all occurences of <!-- foo -->
in a string.
I tried:
thestring.replace(/<!--[\s\S]*-->/gm, "")
but that doesn't work, and even breaks my text.
I can't use .*
as that excludes newlines.
Sample multiline comment:
<!-- foo
bar
baz-->