[TYPO3-core] RFC: Bug 331: Support IPv6 addresses

Michael Stucki michael at typo3.org
Tue Mar 7 13:53:52 CET 2006


Franz Holzinger wrote:

>>+     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.

How? Please make a suggestion if you know how to optimize this.

- michael
-- 
Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/



More information about the TYPO3-team-core mailing list