title: Regex to match all https URLs except a certain path
body: <p>I need a regex that will match all https URLs except for a certain path.</p>
  
  <p>e.g.</p>
  
  <h2>Match</h2>
  
  <p><a href="https://www.domain.com/blog">https://www.domain.com/blog</a>
  <a href="https://www.domain.com">https://www.domain.com</a></p>
  
  <h2>Do Not Match</h2>
  
  <p><a href="https://www.domain.com/forms/">https://www.domain.com/forms/</a>*</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>&lt;rule name="Redirect from HTTPS to HTTP excluding /forms" enabled="true" stopProcessing="true"&gt;
      &lt;match url=".*" /&gt;
      &lt;conditions&gt;
          &lt;add input="{URL}" pattern="^https://[^/]+(/(?!(forms/|forms$)).*)?$" /&gt;
      &lt;/conditions&gt;
      &lt;action type="Redirect" url="http://{HTTP_HOST}/{R:0}" redirectType="Permanent" /&gt;
  &lt;/rule&gt;
  </code></pre>
  
  <p>But it doesn't work</p>