package zhengze;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.regex.*;
import java.util.Date;
public class zhengze {
public static void main(String[] args) throws ParseException {
// String path =
// "/user/sunflower/flume/msp/0/1970-01-01/08/vortex-pro.hadoop0038.bj.voicecloud.cn";
// String reg =
// "^\\d{4}-0[1-9]1[1-2]-0[1-9]|[1-2]\\d|3[0-1] [0-2][0-4]:[0-6]\\d:[0-6]\\d";
// String checkValue = "2009-01-01/12";
// String reg = "^\\d{4}-[0-1]\\d-[0-3]\\d/[0-2][0-4]$";
//
// String reg =
// "^\\d{4}-[0-1][1-9]-[0-3][1-9] [0-2][0-4]:[0-6]\\d:[0-6]\\d$";
//
// Pattern p = Pattern.compile(reg);
// Matcher m = p.matcher(checkValue);
// boolean b = m.matches();
// if(b)
// {
//
// System.out.println("格式正确");
// }
// else
/
java正则匹配解析出时间
最新推荐文章于 2024-04-11 22:07:26 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)