I need a regular expression that only validates an IPv6 address in Javascript. I have tried the following two which both fail on a string like 1:1:1:1:1:1:1:1
^([\dA-F]{1,4}:|((?=.*(::))(?!.*\3.+\3))\3?)([\dA-F]{1,4}(\3|:\b)|\2){5}(([\dA-F]{1,4}(\3|:\b|$)|\2){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5])\.?\b){4})\z
^([0-9A-Fa-f]{0,4}:){2,7}([0-9A-Fa-f]{1,4}$|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.|$)){4})$