Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

URL pattern matching:

by Anonymous Monk
on Jan 29, 2013 at 08:46 UTC ( #1015829=perlquestion: print w/replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Here below there are three urls, https?://(www.)?([^/]*/(?!article).*/(?!video).* - Works - Doesn't work - oesn't work.

Even after adding .* after video url's doesn't match with the above regex, Please suggest the same

Replies are listed 'Best First'.
Re: URL pattern matching:
by moritz (Cardinal) on Jan 29, 2013 at 08:53 UTC - Works

    If by "works" you mean "doesn't match", then I agree. Maybe you should clarify what URLs should match, what URLs should not match, and what information (if any) you are trying to extract.

    I can give you a regex that matches all three URLs: .* but I guess that's not specific enough for you. So be more specific in your requirements.

      Yes. Please help out in matching all the urls.
        The following regex matches all three of them:
        But possibly it is not what you want. As Moritz wrote, you should be more specific what should be matched and what not. And once you wrote detailed specs, maybe you can even find a fitting regex yourself ...
Re: URL pattern matching:
by choroba (Chancellor) on Jan 29, 2013 at 08:55 UTC
    See match the urls. Oh, you have already seen it?
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1015829]
Approved by Corion
[choroba]: Půlnoční Marie (which means Midnight Mary)
[choroba]: but the band is practically dead. We rehearse once in a year, and perform with the same frequency
[ambrus]: `quote
[ambrus]: sorry, typed in the wrong box
[LanX]: Your mother: je ne t'aime plus! ;)
[choroba]: seems lispy
[Your Mother]: Be nice! I speak that much French. Though I also like that song.
[choroba]: So, I joined Pod Černý Vrch some months ago to still have the fun. But I wouldn't call it "punk" anymore...
[LanX]: choroba deaf after one rehearsal per year ?
Discipulus .. per ear!

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (11)
As of 2017-03-24 12:28 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (301 votes). Check out past polls.