public static function uriMatch($pattern, $uri = null)
    {
        if ($uri === null) {
            $uri = self::get('request_uri');
        }
        $uri = trim($uri, '/');
        $pattern = trim($pattern, '/');
        
        $regexp = $pattern;
        if ($pattern{0} != '#') {
            $regexp = '#^' . str_replace('*', '(.*)', $pattern) . '$#';
        }
        
        return (bool) preg_match($regexp, $uri);
    }