public static boolean checkNum(String number) {
String rex = "^[1-9]\\d*(\\.\\d+)?$";
Pattern p = Pattern.compile(rex);
Matcher m = p.matcher(number);
return m.find();
}
原文:https://www.cnblogs.com/csk-1/p/9334983.html