title: Silex optional slug in route
body: <p>I've constructed a URL in Silex to match <code>/tutorial</code> or <code>/tutorial/index</code> or <code>/tutorial/pageX</code> where X is a number, but I'd also like it to match <code>/tutorial/</code> and I'm struggling to make that happen. This is the route I have so far:</p>
  
  <pre><code>$app-&gt;get('/tutorial/{page}', 'app\\Controller\\Tutorial::index')
      -&gt;assert('page', '(^(page[\d]+|index)$|^$)')
      -&gt;value('page', 'index');
  </code></pre>
  
  <p>If I try that <a href="https://regex101.com/r/hT0qL5/2" rel="nofollow">regex in regex101.com</a> it works, having nothing there matches. So why doesn't it work in Silex and what can I use that will work?</p>
  
  <p>Appologies if this is a duplicate but all my searches turned up similar things, but not this exact situation where the whole string must match or be nothing.</p>