JAVA从字符串中提取纯数字

/**
     * 从字符串中提取纯数字
     * @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();
    }
原文地址:https://www.cnblogs.com/pxblog/p/13332292.html