return checkID18(str);
}
else if (Util.test("^\\d{15}$", str))
{
return checkID15(str);
}
else
{
return false;
}
}*/
/*private static boolean checkID18(String str)
{
String year = str.substring(6, 2);
String month = str.substring(8, 2);
String day = str.substring(10, 2);
if (!Util.test("^\\d\\d$", year))
{
return false;
}
if (!isMonth(month))
{
return false;
}
if (!isDay(day))
{
return false;
}
if (Util.parseInt(month) == 2 && Util.parseInt(day) > FEB_DAYES)
{
return false;
}
return true;
}
private static boolean checkID15(String str)
{
String year = str.substring(ID15_YEAR, 4);
String month = str.substring(ID15_MONTH, 2);
String day = str.substring(ID15_DAY, 2);
if (!isYear(year))
{
return false;
}
if (!isMonth(month))
{
return false;
}
if (!isDay(day))
{
return false;
}
if (Util.parseInt(month) == 2 && Util.parseInt(day) > FEB_DAYES)
{
return false;
}
return true;
}*/
/**
*〈验证必须为数字〉
* @param str 待验证字符串
* @param prop prop
* @return boolean
*/
protected static boolean mustNum(String str)
{
if (Util.isEmpty(str))
{
return true;
}
return Util.test("^\\d+$", str);
}
/**
*〈体重验证〉
* @param str 待验证字符串
* @param prop prop
* @return boolean
*/
protected static boolean avoirdupois(String str)
{
if (Util.isEmpty(str))
{
return true;
}
return Util.test("^([3-9]\\d|1\\d\\d)(\\.\\d{0,2}) $", str);
}
/**
*〈验证身高〉
* @param str 待验证字符串
* @param prop prop
* @return boolean
*/
protected static boolean stature(String str)
{
if (Util.isEmpty(str))
{
return true;
}
return Util.test("^([89]\\d|[12]\\d\\d)(\\.\\d{0,2}) $", str);
}
/**
*〈验证年龄〉
* @param str 待验证字符串
* @param prop prop
* @return boolean
*/
protected static boolean age(String str)
{
if (Util.isEmpty(str))
{
return true;
}
return Util.test("^([1-9]|[1-9]\\d )$", str);
}
/**
*〈验证鞋码〉
* @param str 待验证字符串
* @param prop prop
* @return boolean
*/
protected static boolean shoeSize(String str)
{
if (Util.isEmpty(str))
{
return true;
}
return Util.test("(^[34]\\d$)|(^50$)", str);
}
/**
* 判断是否为数字,包含浮点型
* @param str
* @return
*/
public static boolean checkNum(String str)
{
if (Util.isEmpty(str))
{
return true;
}
return Util.test(