2019独角兽企业重金招聘Python工程师标准>>> //正则数字 public boolean isNumeric(String str) { Pattern pattern = Pattern.compile("[0-9]*"); Matcher isNum = pattern.matcher(str); if( !isNum.matches() ) { return false; } return true; } 转载于:https://my.oschina.net/xiahuawuyu/blog/99845