Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
my $html = qq| <!-- HTML comment#1 Some comment --> Some text <!-- HTML comment#2 Some comment --> |;I want to replace all the html comments enclosed in comment tags mentioned above in $html with NULL value, there could be newlines as well in the variable. Can somebody tell me the regex ? I tried below but could not get it working:-
$html =~ s/<!--.*-->//mg;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: removing html comments from the page source
by Herkum (Parson) on Feb 26, 2007 at 12:51 UTC | |
|
Re: removing html comments from the page source
by varian (Chaplain) on Feb 26, 2007 at 10:58 UTC | |
|
Re: removing html comments from the page source
by wfsp (Abbot) on Feb 26, 2007 at 13:44 UTC | |
|
Re: removing html comments from the page source
by hangon (Deacon) on Feb 26, 2007 at 17:52 UTC |