You need to use the g option to your regex to tell it that you want all the
matches in the string.

So

my @result = $html =~ /.*$index.*<blockquote>(.*)<\/blockquote>/g;

should get you closer.
----- Original Message -----
From: "Yuan Cheng" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 25, 2002 8:07 PM
Subject: question about regex


> 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
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to