According MDN Web docs, the Host HTTP header has syntax
<host>:<port>
where the port is optional. If it is all of the requirements, the checker will be just
^(?:\w+(?::\d+)?$)|(?:(\w+\.)+\w+(?::\d+)?)$
First alternative of the regular expression covers first two below cases, and the second alternative covers last two cases:
asdf
asdf:12333
asdf.asdf:123
asdf.asdf.asdf:123
But did not I missed something?
For example, the port number could not be arbitrary large or 00001
...
Or the host part could include some special characters like n-dashes...
Or maybe it could not be checked just by regular expression?