Reputation: 151
I am trying to write a regular expression in which I want to compare the URL's.
Any URL Matches
http://*.xyz.com
Except or Excluding
http://m.xyz.com
and http://m.product.xyz.com
So far I was trying to do it by using if else in RegExp but I couldn't be able to do it right...
(^http:\/\/)(((1)<!(m|m\.product))\.xyz\.co\.jp)?
Upvotes: 0
Views: 52
Reputation: 9619
https?:\/\/(?!m\.|m\.product\.).*\.xyz\..*
This regex accepts all *.xyz.*
domains except m.xyz.*
and m.product.xyz.*
. Also takes care of http
or https
.
Upvotes: 2
Reputation: 10466
You can try that:
^http:\/\/(?!m\.xyz\.com|m\.product\.xyz\.com).*\.xyz\.com$
Upvotes: 3