my $valid_host = qr/\A (?: (?: $RE{net}{IPv6} ) | (?: $RE{net}{IPv4} ) | (?: $RE{net}{domain}{-nospace}{-rfc1101}\.? ) ) \Z/x;