develooper Front page | perl.beginners | Postings from February 2002

question about regex

Thread Next
From:
Yuan Cheng
Date:
February 25, 2002 17:07
Subject:
question about regex
Message ID:
20020226010703.23526.qmail@web13704.mail.yahoo.com
Hi, All:

I have problem with regex. I try to get some content
from a html source and print it out on the screen. 
the following is my code:

use LWP::Simple qw(get);
my $url = "http://www.somewebsite.com";
my $html = get($url);
my $index = "some index number";

my @result = $html =~
/.*$index.*<blockquote>(.*)<\/blockquote>/;
print "$1\n";

I try to catch anything between <blockquote> and
</blockquote> based on $index. The resulte gave me the
first match in the source, which is empty space within
first pair of 
<blockquote>

</blockquote>

how to research the next pair of <blkqt> </blkqt>
which has ssome content inside? I tried several regex,
it just didn't work. Thanks

yc 

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About