67,538
社区成员
发帖
与我相关
我的任务
分享
String str="3.3";
Pattern p=Pattern.compile("[0-9]{0,}.[0-9]{1,}");
Matcher m=p.matcher(str);
System.out.println(m.matches());
String str="00.101";
boolean flag = Pattern.compile("([1-9]+[0-9]*|0)(\\.[\\d]+)?").matcher(str).matches();
System.out.println(flag);