参数1: 0-9正则 参数2: 匹配的字符串 返回值: boolean true: 纯数字类型 false: 不是纯数字类型 boolean flag =Pattern.matches("\\d+$",str);