Pattern p=Pattern.compile("(\\d{4})-(\\d{1,2})-(\\d{1,2})");//從時(shí)間字符串中獲取年禽车,月蒜田,日的正則表達(dá)式
if (StringUtils.isBlank(StrTime)) {
? ? ? Matcher m=p.matcher(endTime);
????if(m.find()){
????????System.out.println("日期:"+m.group());
????????System.out.println("年:"+m.group(1));
????????System.out.println("月:"+m.group(2));
????????System.out.println("日:"+m.group(3));
????}
}