private function matchHostPart($value, &$hostname, &$address) {
        $matches = [];
        $pattern = '~^(?P<name>[a-z0-9\-]+\.[a-z0-9\-\.]+)?\s*(\[(IPv[64])?(?P<addr>[a-f\d\.\:]+)\])?$~i';
        if (preg_match($pattern, $value, $matches)) {
            if (!empty($matches['name'])) {
                $hostname = $matches['name'];
            }
            if (!empty($matches['addr'])) {
                $address = $matches['addr'];
            }
            return true;
        }
        return false;
    }