private function validate($path, $pattern)
{
$pattern = '{' . $pattern . '}u';
$isMatch = 1 === preg_match($pattern, $path);
if (false === $isMatch) {
throw new InvalidPathException(sprintf('"%s" does not match regexp "%s"', $path, $pattern));
}
return $isMatch;
}