title: Is it possible to use capture result in rewrite module second condition?
body: <p>What I am trying to achieve is following, grab the number from the query parameter and see if it exists in referrer header.</p>
  <p>What I've got so far (clearly doesn't work):</p>
  <pre><code>&lt;rule name=&quot;Epic rule in progress, maybe.&quot; stopProcessing=&quot;true&quot;&gt;
    &lt;match url=&quot;^my/path/goes/here&quot; ignoreCase=&quot;true&quot; /&gt;
    &lt;conditions logicalGrouping=&quot;MatchAll&quot; trackAllCaptures=&quot;true&quot;&gt;
      &lt;add input=&quot;{QUERY_STRING}&quot; pattern=&quot;^foo=.*-([0-9]+)$&quot; /&gt;
      &lt;add input=&quot;{HTTP_REFERER}&quot; pattern=&quot;.*{R:1}.*&quot; negate=&quot;true&quot; /&gt;
    &lt;/conditions&gt;
    &lt;action type=&quot;CustomResponse&quot; statusCode=&quot;666&quot; statusReason=&quot;IDK yet.&quot; statusDescription=&quot;The end is near.&quot; /&gt;
  &lt;/rule&gt;
  </code></pre>
  <p>Similar bit slightly different approach (not entirely sure I can fetch query params from match URL):</p>
  <pre><code>&lt;rule name=&quot;Epic rule in progress, maybe.&quot; stopProcessing=&quot;true&quot;&gt;
    &lt;match url=&quot;^my\/path\/goes\/here\?foo=([0-9])&quot; ignoreCase=&quot;true&quot; /&gt;
    &lt;conditions logicalGrouping=&quot;MatchAll&quot;&gt;
      &lt;add input=&quot;{HTTP_REFERER}&quot; pattern=&quot;.*{R:1}.*&quot; negate=&quot;true&quot; /&gt;
    &lt;/conditions&gt;
    &lt;action type=&quot;CustomResponse&quot; statusCode=&quot;666&quot; statusReason=&quot;IDK yet.&quot; statusDescription=&quot;The end is near.&quot; /&gt;
  &lt;/rule&gt;
  </code></pre>
  <p>Example scenario:</p>
  <ul>
  <li>user lands on page &quot;/mypage-123&quot;</li>
  <li>JS on the page triggers a request to &quot;my/path/goes/here?foo=123&quot; (referrer is &quot;/mypage-123&quot;)</li>
  <li>If &quot;123&quot; does not exist in referer, throw status code 666.</li>
  </ul>
  <p>The question is:</p>
  <ul>
  <li>Is it actually possible to achieve what I am trying above?</li>
  <li>Where am I going wrong?</li>
  </ul>