title: Regex for URL ending with optional /
body: <p>I am looking for a Regex pattern to match the following - </p>
  
  <pre><code>https://www.example.org
  https://www.example.org/abc
  </code></pre>
  
  <p>if the string has a trailing <code>/</code>, pattern should ignore it and not add it to the match.
  If there are any query string parameters, It should return the string as is.</p>
  
  <p>I tried ^(.*)(?:/)?$ but this is not ignoring the trailing '/'</p>