I might be doing this the wrong way altogether, I wanted URI to look like :
api/project/start:2015-10-20/end:2016-11-22
$app->get('/api/project/start:{started:(([\d]{4})(-[\d]{1,2})?(-[\d]{1,2})?)}/end:{ended:(([\d]{4})(-[\d]{1,2})?(-[\d]{1,2})?)}',
function ($id, $started, $ended) use ($app) {
echo $id,'<br>'; // 123 - correct
echo 'start ', $started,'<br>'; // 2015-10-20 - correct
echo 'end ', $ended,'<br>'; // 2015 - WTF??
}
);
The started: and ended: regex are identical, phalcon gets the $id, and $started portion correctly, but $ended returns part of $started. The regex is correct, I've checked.