String type = "数字类型";if(StringUtils.isNotBlank(value)){ //区分正负数 if(value.startsWith("-")){ value = value.substring(1); } String reg = "^[0-9]+(.[0-9]+)?$"; if(!value.matches(reg)){ search = "字符类型"; } }else{ search = "字符类型"; }