isIPv6

Checks whether a string has an IPv6 address format

bool
isIPv6
(
string ip
)

Parameters

ip string

the IPv6 address to do check on

Examples

assert(isIPv6("2001:db8:0:1:1:1:1:1"));
assert(!isIPv6("2001:db8:0:1:1:1:1:1xxx"));

Meta