Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Here below there are three urls, https?://(www.)?(abc.com)[^/]*/(?!article).*/(?!video).*

https://www.abc.com/news/video - Works

https://www.abc.com/news/video/ - Doesn't work

https://www.abc.com/news/video/hhj - 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
    https://www.abc.com/news/video - 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.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: URL pattern matching:
by choroba (Cardinal) on Jan 29, 2013 at 08:55 UTC
    See match the urls. Oh, you have already seen it?
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ