title: Rule not working in rewrite rules despite valid regex
body: <p>Our webconfig file uses Url Rewrite, essentially pushing any http traffic to https</p>
  
  <p>This works fine other than developing locally. For a while we have to simply remember to comment out the code from the web.config and uncomment it again for commit. Naturally this isn't a good way to work.</p>
  
  <p>The code is simple</p>
  
  <pre><code>&lt;rewrite&gt;
    &lt;rules&gt;
      &lt;rule name="Redirect-AllWWW-ToSecureNonWWW"&gt;
        &lt;match url="^((?!local).)*$" /&gt;
        &lt;conditions&gt;
          &lt;add input="{HTTP_HOST}" pattern="^(?:www\.)(.+)$" /&gt;
        &lt;/conditions&gt;
        &lt;action type="Redirect" url="https://{C:1}/{R:0}"/&gt;
      &lt;/rule&gt;
      &lt;rule name="Redirect-AllNonSecure-ToSecureNonWWW-ExcludingLocalhost"&gt;
        &lt;match url="^((?!local).)*$" /&gt;
        &lt;conditions&gt;
          &lt;add input="{HTTP_HOST}" pattern="^localhost$" negate="true" /&gt;
          &lt;add input="{HTTPS}" pattern="^off$" /&gt;
          &lt;add input="{HTTP_HOST}" pattern="^(?:www\.)?(.+)" /&gt;
        &lt;/conditions&gt;
        &lt;action type="Redirect" url="https://{C:1}/{R:0}" /&gt;
      &lt;/rule&gt;
    &lt;/rules&gt;
  &lt;/rewrite&gt;
  </code></pre>
  
  <p>And as per the regex101 , it works!
  <a href="https://regex101.com/r/3Mz6w1/1" rel="nofollow noreferrer">https://regex101.com/r/3Mz6w1/1</a></p>
  
  <p>However, when on localhost, I am still directed to HTTPS</p>
  
  <p>Why does it work in regex101 and not in my web.config file</p>