$text =~ s/<[^>]*>//gs; # only for most simple html! $text =~ s/<([^>]|\n)*>//g; # multi-line comments?