title: disallow some domain names, allow others
body: <p>For example there are URLs <strong>http://www.subdomain1.domain.com.uk</strong> and <strong>http://www.subdomain2.domain.uk</strong>, from these URLs I need to extract only the name <em>subdomain1</em> or <em>subdomain2</em>.</p>
  
  <p>But if I receive <strong>http://www.subdomain3.co.uk</strong> or <strong>http://www.subdomain4.com</strong> I need to get the whole URL like <em>subdomain3.co.uk</em> or <em>subdomain4.com</em>.</p>
  
  <p>My expression: <code>^http:\/\/(?:www\.)?((?!SubdomainToNegate|www).*)((?!\.domain\.com\.uk|\.domain\.uk).*)$</code></p>
  
  <p>Expression catches whole URL.</p>
  
  <p>My situation is shown better over there: <a href="http://www.rubular.com/r/B1iOUoUq33" rel="nofollow">http://www.rubular.com/r/B1iOUoUq33</a></p>