in reply to Which one is the better Regex?

/me suggests an alternative solution
use HTML::TokeParser::Simple; my $p = HTML::TokeParser::Simple->new( *DATA ); while(my $t = $p->get_token()) { print $p->get_token()->return_text() and last if $t->is_start_tag('title'); } __DATA__ <html> <head> <title>Nothing to see here</title> </head> </html>
See. Ovid's HTML::TokeParser::Simple for more info on this groovy little module.
HTH

_________
broquaint

Replies are listed 'Best First'.
Re: Re: Which one is the better Regex?
by IlyaM (Parson) on Feb 27, 2003 at 15:25 UTC
    /me suggests another alternative solution
    use XML::LibXML; use FileHandle; my $parser = XML::LibXML->new; my $doc = $parser->parse_html_fh( \*DATA ); print $doc->findvalue('//title'); __DATA__ <html> <head> <title>Nothing to see here</title> </head> </html>
    XML::LibXML and XPath rocks!

    --
    Ilya Martynov, ilya@iponweb.net
    CTO IPonWEB (UK) Ltd
    Quality Perl Programming and Unix Support UK managed @ offshore prices - http://www.iponweb.net
    Personal website - http://martynov.org