Regex: ignore if url contains one of two words -


i tracking clicks of urls , need track ones not contain word "amazon" or "ebay"

eg track this

http://www.website.co.uk/out?prov=tesco* http://www.website.co.uk/out?prov=asda* http://www.website.co.uk/out?prov=youtube* 

but not this

http://www.website.co.uk/out?prov=amazon* 

or

http://www.website.co.uk/out?prov=ebay* 

how approach regex?

the star @ end of url because each url has different parameters

you use below regex match url's except 1 contains amazon or ebay,

http:\/\/www(?!.*amazon|.*ebay).* 

or

http:\/\/www(?!(?:.*amazon|.*ebay)).* 

demo


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -