//用来判断ip是否合法
public boolean checkIp(String tempIp) {String regex = "(25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]?\\d)){3}";Pattern p = pile(regex);Matcher m = p.matcher(tempIp);return m.matches();}
时间:2023-05-23 01:44:57
//用来判断ip是否合法
public boolean checkIp(String tempIp) {String regex = "(25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d{2}|[1-9]?\\d)){3}";Pattern p = pile(regex);Matcher m = p.matcher(tempIp);return m.matches();}