public function getMatch($path, $metadata = null)
{
if ($matches = $this->_getMatches($path)) {
array_shift($matches);
$matches = array_map('urldecode', $matches);
$parameters = empty($matches) ? array() : array_combine($this->_parameters, $matches);
return new RouteMatch($this->_name, $parameters, $metadata);
} else {
if (strlen($path) > 1 && substr($path, -1) == '/') {
return $this->getMatch(rtrim($path, '/'), $metadata);
}
}
return null;
}