EasyRegex Logo
EasyRegex
Nouveau

Match Valid IPv6 URL in Javascript

Javascript

Expression Régulière

/^([0-9a-fA-F]{1,4}:){7}([0-9a-fA-F]{1,4})$/
Copier
Avez-vous des Retours ?

Explication

This regex pattern matches a valid IPv6 URL. It consists of 8 groups of 1 to 4 hexadecimal characters separated by colons.

Javascript

Exemple d'Utilisation

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');
}
Copier
Testez l'expression

Expressions Régulières Similaires