in reply to Regexp to ignore HTML tags

If you're dealing with HTML then you should look at HTML::Parser or one of its subclasses.

Update: Here's one example:

#!/usr/bin/perl use warnings; use strict; use HTML::Parser; my $p = HTML::Parser->new(text_h => [\&text, 'text'], default_h => [\&passthru, 'text']); $p->parse_file(*DATA); sub text { $_[0] =~ s/foo/bar/; print $_[0]; } sub passthru { print $_[0]; } __DATA__ <html> <head><title>foo</title><head> <body> <h1 class="foo">foo<h1> </body> </html>
--
<http://www.dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg