address. Decide whether it holds a valid IPv4 address, a valid IPv6 address or neither, and return "IPv4", "IPv6" or "Neither" accordingly.
**IPv4** is four groups separated by dots: a.b.c.d. Each group is a decimal number from 0 to 255 with no leading zeros. For example, "8.8.4.4" and "100.0.0.0" are fine, while "8.08.4.4", "1.2.3" and "1.2.3.256" are not.
**IPv6** is eight groups separated by colons. Each group has 1 to 4 hex digits: 0–9, a–f or A–F. Leading zeros are allowed. For example, "0db8:0:0:0:0:0:0:1" is fine, while "0db8::1" (empty groups) and "12345:0:0:0:0:0:0:1" (five digits in a group) are not.address="10.0.255.7" → 'IPv4'
Four decimal numbers from 0 to 255 with no leading zeros, separated by dots.
address="fe80:0:0:0:abcd:12:FF:1" → 'IPv6'
Eight groups of 1 to 4 hex digits separated by colons; letter case does not matter.
address="10.0.07.1" → 'Neither'
The group 07 has a leading zero, so this is not IPv4, and it is not IPv6 either.
address contains only English letters, digits and the characters '.' and ':'address="10.0.255.7"
'IPv4'
Run checks the first 3 tests in your browser. Submit checks all 239 tests on the server, hidden ones included.