|
|
| Don't ask to ask, just ask | |
| PerlMonks |
Re: Do I understand this?by LanX (Monsignor) |
| on Jan 16, 2013 at 00:08 UTC ( #1013473=note: print w/ replies, xml ) | Need Help?? |
|
Yes, you do! It deletes HTML-comments, even if they span multiple lines. Anyway it's better (and less buggy) written as $var =~ s/<!--.*?-->//gs EDIT: Please note the .*? for non-greedy now, otherwise you are deleting everything in between the first and the last HTML-comment. see also Regex: Char-class equivalent for [^] for a recent discussion of '.' and '/s'
Cheers Rolf UPDATE: corrected C&P typo ~=
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||