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

Re: match the urls

by tobyink (Abbot)
on Jan 11, 2013 at 09:38 UTC ( #1012845=note: print w/ replies, xml ) Need Help??


in reply to match the urls

use 5.010; use strict; use warnings; my @urls = qw< https://www.abc.com/ap/ap/top-news/76/nTk3M/ https://www.abc.com/videos/news/eye-catching/vmxJr https://www.abc.com/ap/top/45/state-political-news/fgdfgd https://www.abc.com/ap/ap/top-news/ https://www.abc.com/ >; for (@urls) { m{ ^ https://www\.abc\.com/ # correct stem (?: .+? / ){3} # non-greedy string then slash x 3 .+ # at least one other character }x ? say("MATCH: $_") : say("NOT: $_") }
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'


Comment on Re: match the urls
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2014-12-27 02:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls