Come on, just use a real full HTML parser.
use warnings; use XML::Twig; our $doc = q( <title> This is a very good site for regular Expressions. Very helpful. Thanks. </title> <p> Some other text we don't want to extract. ); my $twig = XML::Twig->new; $twig->parse_html($doc); my($title_elt) = $twig->findnodes("//title"); my $title = $title_elt->trimmed_text; print "$title\n" __END__
In reply to Re: How to extract text present in 3 lines within the HTML tags
by ambrus
in thread How to extract text present in 3 lines within the HTML tags
by Saket
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |