From: "Iñaki Baz Castillo" Date: 2008-06-17T21:44:24+09:00 Subject: Re: Can Ruby compare IPv6 ? 2008/6/17, Peña, Botp : > From: Iñaki Baz Castillo [mailto:ibc@aliax.net] > # Hi, is there any cool way in Ruby to match two IPv6 that have > > # the same binary value? For example: > # 2001:0DB8:0:0::0:1428:57ab > # is the same as: > # 2001:0DB8:0::0:1428:57ab > # Can Ruby match those two IPv6 easily without abing to parse > # manually them? > > > require 'ipaddr' > #=> true > > ip1= IPAddr.new "2001:0DB8:0:0::0:1428:57ab" > #=> # fff:ffff:ffff:ffff> > > ip2= IPAddr.new "2001:0DB8:0::0:1428:57ab" > #=> # fff:ffff:ffff:ffff> > > ip1==ip2 > #=> true Terribly great ! :) Thanks. -- Iñaki Baz Castillo