title: problem with regex (find page if given)
body: <p>I've got the these strings:</p>
  
  <pre><code>/search/keyword.html 
  </code></pre>
  
  <p>and </p>
  
  <pre><code>/search/keyword/1.html  # the 1 represents the current page
  </code></pre>
  
  <p>Now I want to write a regex that matches the keyword, and the page, if given.</p>
  
  <p><code>$1</code> (the first match) should always be the keyword (keyword).</p>
  
  <p><code>$2</code> should be the page, if there is one (1).</p>
  
  <p>I tried this but it doesn't work correctly:</p>
  
  <pre><code>~/search/((.*)/(\d*)|(.*)).html~
  </code></pre>
  
  <p><code>$1</code> is not always the keyword and <code>$2</code> not the page (if given).</p>