title: The validator of Host, the HTTP header
body: <p>According <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Host" rel="nofollow noreferrer">MDN Web docs</a>, the Host HTTP header has syntax</p>
  <pre><code>&lt;host&gt;:&lt;port&gt;
  </code></pre>
  <p>where the port is optional. If it is all of the requirements, the checker will be just</p>
  <pre><code>^(?:\w+(?::\d+)?$)|(?:(\w+\.)+\w+(?::\d+)?)$
  </code></pre>
  <p>First alternative of the regular expression covers first two below cases, and the second alternative covers last two cases:</p>
  <pre><code>asdf
  asdf:12333
  asdf.asdf:123
  asdf.asdf.asdf:123
  </code></pre>
  <p><a href="https://regex101.com/r/DEQREq/1" rel="nofollow noreferrer"> Regular expression fiddle</a></p>
  <p>But did not I missed something?
  For example, the port number could not be arbitrary large or <code>00001</code>...
  Or the host part could include some special characters like n-dashes...
  Or maybe it could not be checked just by regular expression?</p>