/** * 从字符串中提取纯数字 * @param str * @return */ public static String getNumeric(String str) { String regEx="[^0-9]"; Pattern p = Pattern.compile(regEx); Matcher m = p.matcher(str); return m.replaceAll("").trim(); }