static void validateHostnamePattern(String hostnamePattern) {
        final boolean validHostnamePattern;
        if (hostnamePattern.charAt(0) == '*') {
            validHostnamePattern =
                    hostnamePattern.length() >= 3 &&
                    hostnamePattern.charAt(1) == '.' &&
                    HOSTNAME_WITH_NO_PORT_PATTERN.matcher(hostnamePattern.substring(2)).matches();
        } else {
            validHostnamePattern = HOSTNAME_WITH_NO_PORT_PATTERN.matcher(hostnamePattern).matches();
        }

        checkArgument(validHostnamePattern,
                      "hostnamePattern: %s (expected: *.<hostname> or <hostname>)", hostnamePattern);
    }
IDNA ASCII conversion, case normalization and validation.
core/src/main/java/com/linecorp/armeria/server/VirtualHost.java