public static boolean IPisCorrect(String ip) {
Pattern p = Pattern
.compile("^(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])$");
Matcher m = p.matcher(ip);
boolean b = m.matches();
return b;
}
原文链接:https://www.f2er.com/regex/362352.htmlpublic static boolean IPisCorrect(String ip) {
Pattern p = Pattern
.compile("^(\\d{1,2}|1\\d\\d|2[0-4]\\d|25[0-5])$");
Matcher m = p.matcher(ip);
boolean b = m.matches();
return b;
}
原文链接:https://www.f2er.com/regex/362352.html