public static function compareSlashes($routePattern, $path)
    {
        $patternSeparator = count(explode('/', $routePattern));
        if (preg_match('/\/$/', $routePattern)) {
            $patternSeparator--;
        }
        $routePattern = preg_replace('/\/\{.*\}$/', '', $routePattern);
        $cleanPatternSeparator = count(explode('/', $routePattern));
        if (preg_match('/\/$/', $routePattern)) {
            $cleanPatternSeparator--;
        }
        $path_sep = count(explode('/', $path));
        if (preg_match('/\/$/', $path)) {
            $path_sep--;
        }
        return abs($patternSeparator - $path_sep) < 1 || abs($cleanPatternSeparator - $path_sep) < 1;
    }