in reply to How to extract text present in 3 lines within the HTML tags
It would be nice practice if you use html parsers for parsing a html like HTML::Parser,
Same practice is also mentioned in perlfaq6 - How do I match XML, HTML, or other nasty, ugly things with a regex?
if you really want to have regex for it then try
my $str ="<title> This is a very good site for regular Expressions. Very helpful. Thanks. </title>"; #print"$str\n"; $str =~ m#<title>(.*?)</title>#gis; my $matched_output = $1; #print"\n$matched_output\n";
|
|---|