in reply to Re^2: regex problem
in thread regex problem
Have solved problem but I dont understand why one lookahead works and another does not.
use strict; use warnings; use WWW::Curl::Easy; my $curl = WWW::Curl::Easy->new; $curl->setopt(CURLOPT_HEADER,1); $curl->setopt(CURLOPT_URL, 'http://www.reddit.com/r/wallpapers.rss'); my $response_body; $curl->setopt(CURLOPT_WRITEDATA,\$response_body); # Starts the actual request my $retcode = $curl->perform; # Looking at the results... if ($retcode == 0){ print("Transfer went ok\n\n"); my $response_code = $curl->getinfo(CURLINFO_HTTP_CODE); my @urls=$response_body =~ m{(http://b.thumbs.redditmedia\.com/(?:( +?!png).)*?\.jpg)}gi; $" ="\n\n"; print "@urls\n"; } else { # Error code, type of error, error message print("An error happened: $retcode ".$curl->strerror($retcode)." ".$ +curl->errbuf."\n"); }
Thank you all that helped.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: regex problem solved
by AnomalousMonk (Archbishop) on Nov 05, 2015 at 00:48 UTC |