src/Header/Consumer/Received/DomainConsumer.php
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;
    }
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;
    }
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 ; }
Attempts to match a parenthesized expression to find a hostname and an
address.  Returns true if the expression matched, and either hostname or
address were found.

@param string $value
@param string $hostname
@param string $address
@return boolean
Attempts to match a parenthesized expression to find a hostname and an address . Returns true if the expression matched and either hostname or address were found .