第1个回答 2011-11-08
匹配非负整数(正整数 + 0)
public static final String non_negative_integers_regexp = "^\\d+$";
匹配不包括零的非负整数(正整数 > 0)
public static final String non_zero_negative_integers_regexp = "^[1-9]+\\d*$";
匹配正整数
public static final String positive_integer_regexp = "^[0-9]*[1-9][0-9]*$";