public static boolean checkip(String ip) {
final Pattern IP_PATTERN = Pattern.compile("([1-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])){3}");
return IP_PATTERN.matcher(ip).matches();
}
java ip检验
最新推荐文章于 2024-04-03 19:50:54 发布