protected function getNestedPrefix($pattern)
    {
        $segments = explode("/", $pattern);
        $pattern = "";

        foreach ($segments as $index => $segment) {
            if (strpos($segment, "{") === 0) {
                   $pattern .= "/{" . $segments[$index - 1] . "_" . ltrim($segment, "{");
            } else $pattern .= $segment;
        }

        return $pattern;
    }