Fix ip regex bug
This commit is contained in:
parent
7942a08c84
commit
5362627f35
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
|
||||
public static boolean isIp(String ip) {
|
||||
return ip.matches("^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$");
|
||||
return ip != null && !ip.equals("") && ip.matches("^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue