if ($prev->
isA(EmailLexer::S_COLON
)) { $this->warnings
[IPV6ColonEnd::CODE
] =
new IPV6ColonEnd();
} $IPv6 =
substr($addressLiteral, 5
);
//Daniel Marschall's new IPv6 testing strategy
$matchesIP =
explode(':',
$IPv6);
$groupCount =
count($matchesIP);
$colons =
strpos($IPv6, '::'
);
if (count(preg_grep('/^[0-9A-Fa-f]{0,4}$/',
$matchesIP, PREG_GREP_INVERT
)) !== 0
) { $this->warnings
[IPV6BadChar::CODE
] =
new IPV6BadChar();
} if ($colons === false
) { // We need exactly the right number of groups
if ($groupCount !==
$maxGroups) { $this->warnings
[IPV6GroupCount::CODE
] =
new IPV6GroupCount();
} return;
} if ($colons !==
strrpos($IPv6, '::'
)) {