my $stuff = do { local $/; <DATA> }; $stuff =~ s/<!--.*?--\s*>//gs; print "$stuff\n"; __DATA__ asdfasdkf <!-- asdfaskdf --> Hello <!-- World -->
Please don't make me use the modules!You make it sound like they're haunted or something...
Update: Hey, your second regex worked for this data. Are you sure it doesn't work for you?
Update2: The spec allows for whitespace between the closing -- and >: updated the regex accordingly.
blokhead
In reply to Re: Removing html comments with regex
by blokhead
in thread Removing html comments with regex
by n4mation
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |