非负数正则表达式

public static Boolean isNotNegative(String str) {
        String pattern = "^\\d+(\\.{0,1}\\d+){0,1}$";
        Pattern r = Patternpile(pattern);
        boolean matches = r.matcher(str).matches();
        return matches;
    }

更多推荐

非负数 正则表达式