RegexBench

← Library

IPv6 (simplified)

Common full and compressed IPv6 forms.

Pattern

/\b(?:[0-9a-f]{1,4}:){7}[0-9a-f]{1,4}\b|\b(?:[0-9a-f]{1,4}:){1,7}:\b|\b::(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4}\b/

Sample text

Full 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Compressed 2001:db8::1
Not v6 192.168.0.1
Test this pattern in the editor

Related patterns