title: Regex match for optional trailing slash
body: <p>I'm trying to match:
  </p>
  
  <pre class="lang-none prettyprint-override"><code>/app
  /app/
  /app/**
  </code></pre>
  
  <p>but not:</p>
  
  <pre class="lang-none prettyprint-override"><code>/app**
  </code></pre>
  
  <p>The trailing slash should be optional. I can't quite get it to work.</p>
  
  <p><code>^/app/([^/]*)/?</code> matches <code>/app/</code> and <code>/app/**</code>, but not <code>/app</code>.</p>