protected function getParameterizedPattern()
{
$params = array();
$values = array();
if ($this->_parameters) {
foreach ($this->_parameters as $key => $value) {
$params[] = '{' . $key . '}';
$values[] = '(?P<' . $key . '>' . $value . ')';
}
}
if ($this->getIsWildCardPattern()) {
$params[] = '{*}';
// service parameter must not contain '=' and '/'
$values[] = '(?P<' . $this->getServiceID() . '>[^=/]+)';
}
$params[] = '/';
$values[] = '\\/';
$regexp = str_replace($params, $values, trim($this->getPattern(), '/') . '/');
if ($this->_urlFormat === THttpRequestUrlFormat::Get) {
$regexp = '/^' . $regexp . '$/u';
} else {
$regexp = '/^' . $regexp . '(?P<urlparams>.*)$/u';
}
if (!$this->getCaseSensitive()) {
$regexp .= 'i';
}
return $regexp;
}