Any good ways of improving this as an ipv6 validator? Calling scripts
assume it's valid unless nil.

Leam

####

  def self.ipv6(ip)
    return nil if ip.match(/:::/)
    ip_array = ip.split(":")
    return nil if ip_array.count > 8 or ip_array.count < 1
    ip_array.each do |octet|
      return nil if octet.length > 4
      return nil if octet.match(/[^[:xdigit:]]/)
    end
    return ip
  end

####

-- 
Mind on a Mission <http://leamhall.blogspot.com/>
(supressed text/html)
Unsubscribe: <mailto:ruby-talk-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>