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