In this problem, your job to write a function to check whether a input string is a valid IPv4 address or IPv6 address or neither. IPv4 addresses are canonically represented in dot-decimal notation, which consists of four decimal numbers, each ranging…
package site.wangxin520.test; import sun.net.util.IPAddressUtil; public class Test { public static void main(String[] args) throws Exception { // String ip = "192.168.110.250"; // String ip = "11100100.00000100.00000101.11111101"; // S…
Write a function to check whether an input string is a valid IPv4 address or IPv6 address or neither. IPv4 addresses are canonically represented in dot-decimal notation, which consists of four decimal numbers, each ranging from 0 to 255, separated by…