Checks whether a string has an IP address format (both IPv4 and IPv6)
the IP address to do check on
assert(isIP("192.169.0.0")); assert(isIP("2001:db8:0:1:1:1:1:1")); assert(!isIP("192.169.0.500")); assert(!isIP("2001:db8:0:1:1:1:1:1xxx"));
See Implementation
Checks whether a string has an IP address format (both IPv4 and IPv6)