Pattern p=Pattern.compile("(\\d{4})-(\\d{1,2})-(\\d{1,2})");
Matcher m=p.matcher(disableTime);
int disableDay = 0;
while(m.find())
{
disableDay=Integer.parseInt(m.group(3));
}
上面的disableTime是2014-07-20
为什么m.find()是false
(\d{4})-(\d{2})-(\d{2})