开发者

Searching Movie name in the Download URL

We require to verify, if the given URL has searchStringKeyword using regular expression.

for example

if URL : http://thepiratebay.org/torrent/3962906/Mera.Naam.Joker.1970.LiMiTED.DVDRiP.XviD-D3开发者_StackOverflow社区Si"

searchStringKeyword : Mera Naam Joker
expected outcome: true

searchStringKeyword : DVDRiP
expected outcome: true

searchStringKeyword : Speed
expected outcome: false

Any help would be highly appreciated.

Amit


Your examples aren't quite comprehensive.

If you want to match any URL with the words "Mera", "Naam", and "Joker", in that order, but with any number of characters separating them, you could use this:

/Mera.*Naam.*Joker/

If you want there to be one and only one separating character, but you don't care what that character is, you could use this:

/Mera.Naam.Joker/

If you want there to be a single . character between the words, like this:

/Mera\.Naam\.Joker/


if you are using regex à la PERL, the patterns would be these :

/DVDRip/
/Mera\W+Naam\W+Joker/
/Speed/
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜