验证字符串为数字
public static void main(String[] args) { System.out.println(Pattern.matches("^[0-9]+$", "12a63")); // true:是数字,false:非数字}