title: Regex for matching url path but without params, first group match
body: <p>Let's say I have urls like these</p>
  <ol>
  <li><code>https://example.com/link</code></li>
  <li><code>https://example.com/link?code=1234</code></li>
  <li><code>https://example.com/link/with/longer/path</code></li>
  </ol>
  <p>What I need is to match accordingly:</p>
  <ol>
  <li><code>link</code></li>
  <li><code>link</code></li>
  <li><code>link/with/longer/path</code></li>
  </ol>
  <p>This regex: <code>^(?:[^/]*(?:/(?:/[^/]*/?)?)?([^?]+)(?:\??.+)?)$ </code> is able to group a path, but because of a tool I use, I need to match preciesliy just that one group - this regex matches whole URLs.</p>
  <p>Can I make it match just the first group? Or maybe there is something smarter to do it?</p>