title: URL Rewriting in Varnish - Remove unwanted URL parameters
body: <p>My application is generating pages based off of 4 unique URL parameters and I'm trying to get varnish to cache the page. This scenario is a bit unusual as I have no control over the amount or the order of the URL parameters being passed to my application. With my limited regex skill set and googling abilities, I've found a solution to match the parameters that I want:</p>
  
  <pre><code>[&amp;|?](?:Param1|Param2|Param3|Param4)=[^&amp;\s]+
  </code></pre>
  
  <p>But due to the limitations of VCL, I need the exact opposite:</p>
  
  <pre><code>Match any URL parameters that are not Param1, Param2, Param3 or Param4.
  </code></pre>
  
  <p>Then remove from URL, set hash_data based off url, forward to my backend and I should be golden. </p>
  
  <p>I'm hoping someone with some regex experience can share a solution or point me in the right direction. Thank you.</p>