title: Problem with basic regex to match ending optional character
body: <p>Hi all i was hoping someone could help be with some basic regex i am really struggling with.</p>
  
  <p>Bascially i need to match a url for redirection. I have been using </p>
  
  <pre><code>^~/abc(/)?
  </code></pre>
  
  <p>however i need to change the end part to just check the last optional character as this will also match <code>^/abcd</code></p>