title: Regex to exclude specific urls
body: <p>I'm trying to create a regex to match URLs from my domain, but will exclude the following three URLs:</p>
  
  <ul>
  <li>www.mydomain.com/      </li>
  <li>www.mydomain.com/contact</li>
  <li>www.mydomain.com/about</li>
  </ul>
  
  <p>The regex should also exclude these URLs if they have query parameters. I am struggling with how to approach this problem, and any help is appreciated.</p>
  
  <p>I have tried something very similar to what Rizwan posted, but as you can see, this one allows for some urls which should be excluded (like test/www.mydomain.com/)</p>
  
  <p>I have also tried using negative lookaheads, but didn't get very far with that.... it was something like</p>
  
  <pre><code>^(www.mydomain.com)?\/(?!.*(about|contact)).*$
  </code></pre>
  
  <hr>