public static boolean isValidIP(String ip) {final Pattern IP_PATTERN = Pattern.compile("^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).)" + "{3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$");return IP_PATTERN.matcher(ip).matches();}
This could also be done usingInetAddress.getByName(String host)
Публикуване на коментар
1 коментар:
This could also be done using
InetAddress.getByName(String host)
Публикуване на коментар