This regex pattern matches a valid IPv6 URL. It consists of 8 groups of 1 to 4 hexadecimal characters separated by colons.
const regex = /^([0-9a-fA-F]{1,4}:){7}([0-9a-fA-F]{1,4})$/;
const ipv6URL = '2001:0db8:85a3:0000:0000:8a2e:0370:7334';
if(regex.test(ipv6URL)) {
console.log('Valid IPv6 URL');
}
Copy