fix($urlMatcherFactory): handle optional parameter followed by required parameter in url format

Fix to address issue #1378.