Better regex for hostnames.
This is related to OPCUA-918, probably solves it.
It rejects some more invalid hostnames (ending dot) and allows more valid ones (containing dashes). Though it is not yet perfect and tolerates hostnames beginning with dashes.