[TYPO3-core] RFC: Bug 331: Support IPv6 addresses
Franz Holzinger
franz at fholzinger.com
Tue Mar 7 10:52:41 CET 2006
Hello Michael,
>Problems:
>The patch adds quite a lot of new functions. I wonder if it would make sense
>to move them into a separate file therefore?
>
>
>
yes, this should come into a new file.
>+ function validIPv6($ip) {
>+ $uppercaseIP = strtoupper($ip);
>+
>+ $regex = "/^(";
>+ $regex.= "(([\dA-F]{1,4}:){7}[\dA-F]{1,4})|";
>+ $regex.= "(([\dA-F]{1,4}){1}::([\dA-F]{1,4}:){1,5}[\dA-F]{1,4})|";
>+ $regex.= "(([\dA-F]{1,4}:){2}:([\dA-F]{1,4}:){1,4}[\dA-F]{1,4})|";
>+ $regex.= "(([\dA-F]{1,4}:){3}:([\dA-F]{1,4}:){1,3}[\dA-F]{1,4})|";
>+ $regex.= "(([\dA-F]{1,4}:){4}:([\dA-F]{1,4}:){1,2}[\dA-F]{1,4})|";
>+ $regex.= "(([\dA-F]{1,4}:){5}:([\dA-F]{1,4}:){0,1}[\dA-F]{1,4})|";
>+ $regex.= "(::([\dA-F]{1,4}:){0,6}[\dA-F]{1,4})";
>+ $regex.= ")$/";
>
>
I think it should be possible to find a more simple regular expression
for that.
Greets,
Franz
More information about the TYPO3-team-core
mailing list