title: Remove entire querystring using regex
body: <p>I have the below regex, but how can I remove the querystring entirely if it is present:</p>
  
  <pre><code>^~/(.*)/restaurant/(.*)
  </code></pre>
  
  <p>eg. the url </p>
  
  <pre><code>/seattle/restaurant/sushi?page=2 
  </code></pre>
  
  <p>or </p>
  
  <pre><code>/seattle/restaurant/sushi?somethingelse=something 
  </code></pre>
  
  <p>or </p>
  
  <pre><code>/seatthe/restaurant/sushi 
  </code></pre>
  
  <p>should just return <code>seattle</code> and <code>restaurant</code> and <code>sushi</code> and remove any querystring if it is present.</p>
  
  <p>(sorry for reposting a similar question, but I couldn't get the answer to work in my previous question).</p>
  
  <p>thanks</p>
  
  <p>Thomas</p>