一个正则表达式都弄不明白?生气,记录一下
public class ApiDataPortConstants
{
/**
* 日期时间正则表达式
*/
public final static String DATE_TIME_REGULAR_EXPRESSION = “([0-9]{4})-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]) ([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]”;
/**
* 日期正则表达式
*/
public final static String DATE_REGULAR_EXPRESSION = "([0-9]{4})-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])";
/**
* 数字正则表达式(正数,可以小数)
*/
//public final static String NUMBER_REGULAR_EXPRESSION = "-?[0-9]+.?[0-9]*";
//public final static String NUMBER_REGULAR_EXPRESSION = "^(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*))$";
public final static String NUMBER_REGULAR_EXPRESSION = "^(\\d+)(\\.\\d+)?$";
/**
* 数字正则表达式(正整数)
*/
public final static String INTEGER_REGULAR_EXPRESSION = "^[1-9]\\d*$";
}