// 必须定义 `ShowMeBug` 入口类和 `public static void main(String[] args)` 入口方法
import java.util.Date;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ShowMeBug {
public static final String KEY_USERNAME = "username";
public static boolean isIpAddress(String value) {
Pattern pattern = Pattern.compile("^((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]"
+ "|[*])\\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]|[*])$");
return pattern.matcher(value).matches();
}
public int delete() {
return 0;
}
public static void main(String[] args) {
String default_modify_time = null;
Date date = new Date();
java.text.DateFormat format2 = new java.text.SimpleDateFormat("yyyyMMddHHmmss");
default_modify_time = format2.format(date);
System.out.println(default_modify_time);
StringBuilder builder = new StringBuilder("write_raw logo ");
builder.append("default ");
if(isIpAddress("192.168.11.1"))
System.out.println(builder.toString());
}
}
java正则表达式判断是否IP地址
最新推荐文章于 2024-08-21 00:06:52 发布