IPv6 Address
✓ ValidationMatches full IPv6 addresses (simplified pattern).
✓ Matches
2001:0db8:85a3:0000:0000:8a2e:0370:7334fe80:0000:0000:0000:0000:0000:0000:0001
✗ Does Not Match
192.168.1.12001:db8::1invalid
Code Examples
1const regex = /^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/i;2const str = '2001:0db8:85a3:0000:0000:8a2e:0370:7334';34// Test if string matches5const isMatch = regex.test(str);6console.log('Match found:', isMatch);78// Find all matches (add 'g' flag for multiple matches)9const matches = str.match(regex);10console.log('Matches:', matches);1112// Find matches with details13let match;14const regexWithGlobal = /^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/ig;15while ((match = regexWithGlobal.exec(str)) !== null) {16 console.log('Match:', match[0], 'Index:', match.index);17}
About IPv6 Address Regular Expression
This regex pattern is designed to matches full ipv6 addresses (simplified pattern).. It can be used in JavaScript, Python, PHP, Java, and other programming languages that support regular expressions.
How to Use This Pattern
- Copy the regex pattern above
- Use the "Try in Tester" button to test it with your own data
- Use the code generator to get implementation code in your preferred language
Pattern Breakdown
Understanding each part of this regex will help you modify it for your specific needs. Click the "Explanation" tab in the tester to see a detailed breakdown of each component.