Hi There - I am hoping that someone can help me. I am not exactly sure how to use the following regex. I am using classic ASP with Javascript
completehtml = completehtml.replace(/\<\!-- start-code-remove --\>.*?\<\!-- start-code-end --\>/ig, '');
I have this code to remove everything between
<\!-- start-code-remove --\>and<\!-- start-code-end --\>
It works perfect up to the point where there is line breaks in the values between start and end code...
How will I write the regex to remove everything between start and end even if there is line breaks
Thanks a million for responding...
Shoud I use the \n and \s characters not 100% sure..
(/\<\!-- start-code-remove --\>\s\n.*?\s\n\<\!-- start-code-end --\>/ig, '');
also the code should not be greedy between <\!-- start-code-remove --\> <\!-- start-code-end --\>/ and capture the values in groups...
There could be 3 or more of these sets...