[perl] delete html comments

Status
Not open for further replies.
I have a string containing html code. Now I'd like to delete all comments (everything between <!-- and -->).
Doing
Code:
$string =~  s/<!--(.*)-->//g;
seems to delete everything from first '<!--' to last '-->'. (Instead of deleting only until the next '-->').

How do I need to modify my regex to remove the stuff only between opening and closing comment marks?
 
Status
Not open for further replies.