title: Use Regex to lookahead and redirect in case of match IIS
body: <p>I have the following IIS rule which is supposed to redirect if the URI does not contain the word <code>Api</code>:</p>
  
  <pre><code>         &lt;rule name="React Routes" stopProcessing="true"&gt;
              &lt;match url=".*" /&gt;
              &lt;conditions logicalGrouping="MatchAll" trackAllCaptures="false"&gt;
                  &lt;add input="{REQUEST_URI}" pattern="^((?!Api).)*$" negate="false" /&gt;
              &lt;/conditions&gt;
              &lt;action type="Rewrite" url="/" /&gt;
          &lt;/rule&gt;
  </code></pre>
  
  <p>This was working fine until I added a token as a query parameter for a route. Now when it tries to match that URI it will go out of memory.</p>
  
  <p>How would I have to write the pattern so it looks only in the first 30 characters? The <code>/Api/</code> route will never appear later. This way I will make sure that the regular expression matching does not run out of memory when a token is present. </p>