public function explodeSegments($uri)
    {
        $segments = [];

        $pattern = "|/*(.+?)/*$|";
        $elements = explode("/", preg_replace($pattern, "\\1", $uri));

        foreach ($elements as $val) {
            $val = trim($this->filterUri($val));
            empty($val) || $segments[] = $val;
        }

        return $segments;
    }