I'am trying to use regexp to strip all html comments from .html file.
As we know html comments format are <!-- some comments -->
I've create such regexp
/<!--.*-->/gs
It works, but if there is more than one comment block in file, it strips no one to another block, but all from first <!--
to last -->
F.e.
some html tags
<!-- some comments 1 -->
some html tags 2
<!-- some comments 2-->
It strips entire
<!-- some comments 1 -->
some html tags 2
<!-- some comments 2-->
I'am code with ActionScript language. Any advice would be helpful. Thanks!
Use the question mark to make the asterisk lazy:
use this regex
/<!--.*?-->/gs