java string获取数字(整数,小数)

 1 // 小数
 2 Pattern.compile("(\d+\.\d+)");
 3 
 4 // 整数
 5 Pattern.compile("\d+");
 6 
 7 
 8 Pattern pattern = Pattern.compile(规则);
 9         Matcher matcher = pattern.matcher(content);
10         if (matcher.find()) {
11             return matcher.group(0);
原文地址:https://www.cnblogs.com/dapped/p/8868663.html