[2] [DFN[IPv6 [RUBYB[アドレス]@en[address]]]]は、[[IPv6]] において通信の当事者を[[識別]]する[RUBY[[[番地]]]@en[[[アドレス]]]]です。 * メモ [1] [CITE@en[IPv6 validation (and caveats) - Crisp's blog]] ([TIME[2009-07-05 12:39:37 +09:00]] 版) >I started out with the RFC mentioned in the title of the request, which was RFC-2732 which referred to RFC-2373 for the ABNF syntax of IPv6 >however, I quickly noticed that this expression (and thus the ABNF in the RFC) couldn't be correct because it doesn't limit the number of hex4 groups and is totally wrong in the way it checks for an IPv4 formatted part. > Luckily this has been fixed in RFC-3986 which mentions the following ABNF >Now that's something else... Also note how this strictly defines the format of an IPv4 address. This either called for a monstrous regular expression or a tokenizing approach. I started out with the latter but quickly abandoned it because it became rather chaotic and didn't perform very well. >These are 3 examples of invalid addresses which pass using PHP's filter_var: [PRE[ ::01.02.03.04 (leading zero's not allowed in IPv4 part digits) 0:0:0:255.255.255.255 (not enough parts and no compression) 1fff::a88:85a3::172.31.128.1 (only one part may be compressed) ]PRE]