http host and http_raw_host keywords

IN case of http_raw_host kewyord, if the hostname is present in the Host keywrod only and not the uri, is there any way to extract just the hostname from the header.  Currently I am using the http host header and that contains the entire header value, hence the port as well.