I wrote the regular new RegExp('(<%--)(.*)(--%>)','gim') regular new RegExp('(<%--)(.*)(--%>)','gim') , which should find everything that is enclosed in a sequence of <%-- --%> characters. It works fine within one line, but if there is a line break between the <%-- --%> character sequences, then everything will break. I decided to catch line breaks in such a regular way: (<%--)([\s\S]*)(--%>) , but it does not work correctly.
Tell me, how to write the regularity which will take into account the line breaks?