in reply to Comment Removal

What about nested comments, however? It's much better to use a module for something like this, rather than try to work out your own regex.
use strict; use warnings; $_ = join '', <DATA>; s/<!--.*?-->//gs; print; __DATA__ <!-- comment -->text <!-- multi-line comment -->text2 <!-- nested <!-- comment --> -->text3
returns...
text text2 -->text3

Replies are listed 'Best First'.
Re^2: Comment Removal
by halley (Prior) on Oct 17, 2005 at 15:08 UTC