Wednesday, 15 August 2012

java - Regular expression for URL which not containing youtube -


I want to create a regular expense that matches the URL to a URL with "YouTube".

I did this regexp that matches all the URLs:

  (www + \.)? [\ W]] + s {0,3} [/..,!!] {1, 3} s {0.3} (r [o0] | n [E3] t | lt | c [o0] meter | [I!] NF [o0] | [o0] rg | b [! I] [z2] | ru | [E3] du) (\ /)?   

But I want to add to regular expressions, if the URL contained in YouTube does not match.

We have a large system that we have received sentences, and for each sentence, we apply many regular expressions for example. And I want a regular expense which says this sentence is the URL but not "YouTube".

Is this possible?

Thanks

I will do this:

Reggae < / H2>
  (www + \.)? (?! Youtube) ([\ w -] s {0.3}) [/ \,;:!!] {1,3} s {0.3} (r [o0] | n [E3] t | lt | c [O0] meter | [me!] Nf [o0] | [o0] rg | b [i!] [Z2] | ru | [E3] du) (\ /)?   

regular expression image

test
  youtube.com = & gt; No match test.n3t = & gt; Match wwwwwww.coucous :: 3du = & gt; YouTube; ;; R = 0> Match    

No comments:

Post a Comment