import java.util.regex.Matcher
public boolean isNumeric(String str) { Pattern pattern = Pattern.compile("[0-9]*"); Matcher isNum = pattern.matcher(str); if( !isNum.matches() ) { return false; } return true; }
原文链接:https://www.f2er.com/regex/361942.html