here my sample FastRoute for slim3 :
$app->get('/api/search/[{domaine}[/{notused:.+}]]', function ($request, $response, $args) {
return $this->renderer->render($response, 'index.phtml', $args);
});
with this FastRoute "regex" ([{domaine}[/{notused:.+}]]), I match :
/api/search/sample.com
/api/search/sample.com/test
/api/search/
And $args['domaine'] return "sample.com".
but I want to match this too :
/api/search/http://sample.com
/api/search/https://sample.com
add new route like this work :
$app->get('/api/search/http://[{domaine}[/{notused:.+}]]' ...
$app->get('/api/search/https://[{domaine}[/{notused:.+}]]' ...
But it's better to have just one line.
Any ideas ?