Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Negate link search in Mechanize

by mwp (Hermit)
on Nov 02, 2011 at 04:57 UTC ( #935292=note: print w/ replies, xml ) Need Help??


in reply to Negate link search in Mechanize

You might be over-thinking it.

my @links = grep $_->url !~ /foo/, $mech->links;

Update: I might be under-thinking it. :-)

Update 2: ology points out Negation/Complement of a Regex, which leads into a twisty labyrinth of prior art, including Negating Regexes: Tips, Tools, And Tricks Of The Trade.

mwp


Comment on Re: Negate link search in Mechanize
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2014-07-13 08:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (248 votes), past polls