/**
*IP
地址校验
*
@param
ipStr
*
@return
*/
public static boolean
isIP(String ipStr) {
String num =
"(25[0-5]|2[0-4]
\\
d|[0-1]
\\
d{2}|[1-9]?
\\
d)"
;
String regex =
"^"
+ num +
"
\\
."
+ num +
"
\\
."
+ num +
"
\\
."
+ num +
"$"
;
Pattern pattern = Pattern.
compile
(regex);
Matcher matcher = pattern.matcher(ipStr);
return
matcher.matches();
}