title: URL routing - regex match with trailing slash and without
body: <p>I am using <a href="https://github.com/teresko/spiffy-route" rel="nofollow">Spiffy-Route</a> library to route my URLs. Everything is great, able to freely route the needed urls, but I am not really able to add a wildcard, as it's not included in the api.</p>
  
  <p>My route looks like this:</p>
  
  <pre><code>/{id:\d+}-{string}
  </code></pre>
  
  <p>Means I can route to it like this:</p>
  
  <pre><code>.com/5-helloworld
  </code></pre>
  
  <p>But when I route to it like this:</p>
  
  <pre><code>.com/5-helloworld/
  </code></pre>
  
  <p>It will not find a match, because of the slash. I have tried doing <code>/{id}-{string}/?</code> but the parameter {string} will include all the slashes after it inside it's value.</p>
  
  <p>I have been going through some <em>Regex</em> questions over stackoverflow, to find out how to make the pattern support with slash and without - the common answer was <code>([^/]+)</code>, but this piece of regex doesn't really affect at all in my case.</p>
  
  <p>How can I do this with Spiffy router?</p>
  
  <p>If I do something like <code>/{id}-{string}([^/]+)/?</code> and route to it like this: <code>/5-hey/</code></p>
  
  <p>The output will be <code>5he</code> instead of <code>5hey</code> according to this echo:</p>
  
  <pre><code>echo parent::getRouteMatch()-&gt;get('id') . parent::getRouteMatch()-&gt;get('string');
  </code></pre>
  
  <p><strong>Will I have to modify the API to get this to work?</strong></p>