标签:OLE 字符串 div public void 表达 nbsp mat gtest
public class StringTest { public static void main(String[] args) { String regex = "\\A(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}\\z"; String str1 = "1.1.1.0"; boolean flag1 = str1.matches(regex); System.out.println(flag1); String str2 = "222"; boolean flag2 = str2.matches(regex); System.out.println(flag2); } }
标签:OLE 字符串 div public void 表达 nbsp mat gtest
原文地址:https://www.cnblogs.com/zhanzhuang/p/10976838.html