public function match(Request $request)
    {
        $method = $request->httpmethod();
        if (strtoupper($method) != strtoupper($this->method)) {
            return false;
        }
        // TODO: check uri
        $regex = $this->uriRegex($this->uri);

        $path = parse_url(trim($request->uri(), '#'), PHP_URL_PATH);
        $match = preg_match("/{$regex}/", $path, $matches);
        if (!$match) {
            return false;
        }

        if ($matches[0] != $path) {
            return false;
        }

        $request->setRouteParams($matches);

        return true;
    }