init
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package com.ruoyi.cai.util;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ReUtil;
|
||||
|
||||
public class IpAddressUtil {
|
||||
|
||||
public static boolean isIp(String ip){
|
||||
if(ip == null || ip.length() < 7 || ip.length() > 15){
|
||||
return false;
|
||||
}
|
||||
return ReUtil.isMatch("([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}",ip);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user