Hostname route should throw an exception if route definition contains disallowed character

If a hostname route is constructed with a route containing a disallowed character (one outside of `[a-z0-9-.]`) a RuntimeException should be thrown, as the route is misconfigured. 

Fixes #5656
It returns a `bool` in case of an error. When there are not matches `0` is returned.

http://php.net/preg_match
> preg_match() returns 1 if the pattern matches given subject, 0 if it does not, or FALSE if an error occurred.