IPv6 Address (Simplified)
advancedMatches common IPv6 address formats including compressed notation.
ipipv6networkvalidation
Pattern
/(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|(?:[0-9a-fA-F]{1,4}:)*:(?::[0-9a-fA-F]{1,4})*/gTry It
0 of 6 strings matched
Explanation
Matches full IPv6 addresses (8 groups of 4 hex digits separated by colons) or compressed format with :: for consecutive zero groups.
Test Strings
Matching
- 2001:0db8:85a3:0000:0000:8a2e:0370:7334
- ::1
- fe80::1
Non-matching
- 192.168.1.1
- hello
- 1234
Language Compatibility
| Language | Support |
|---|---|
| JS | Full support |
| PYTHON | Full support |
| JAVA | Full support |
| PHP | Full support |
| GO | Full support |
Code Snippets
const regex = /(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|(?:[0-9a-fA-F]{1,4}:)*:(?::[0-9a-fA-F]{1,4})*/g;
const text = "your text here";
const matches = text.match(regex);
console.log(matches);