protected function findValueToMatch($routePath)
{
if (!isset($routePath) || $routePath === '' || $routePath[0] === '/') {
return '';
}
if ($this->getUriPattern() === '') {
return parent::findValueToMatch($routePath);
}
$regexPattern = preg_quote($this->getUriPattern(), '/');
$regexPattern = preg_replace('/\\\\{[^}]+\\\\}/', '[^\\/]+', $regexPattern);
if ($this->splitString !== '') {
$regexPattern .= '(?=' . preg_quote($this->splitString, '/') . ')';
}
$matches = [];
preg_match('/^' . $regexPattern . '/', trim($routePath, '/'), $matches);
return isset($matches[0]) ? $matches[0] : '';
}