Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: regex problem

by ExReg (Priest)
on Nov 03, 2015 at 23:36 UTC ( [id://1146857]=note: print w/replies, xml ) Need Help??


in reply to Re: regex problem
in thread regex problem

If indeed you are looking for .jpg files under http://b.thumbs.redditmedia.com/ that do not have png in their names, it might be easiest to just get rid of your lookaheads and lookbehinds

my @urls=$response_body =~ m{(http://b.thumbs.redditmedia.com/.+?\.jpg)}gi;

and then add another line to get rid of the lines in the just created @urls that have png in them. Writing regexes that must match one thing but cannot match another are prone to caveats or are not blazingly intuitive.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1146857]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-25 12:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found