62,616
社区成员
发帖
与我相关
我的任务
分享
public static void processS3() {
String S3 = "where FASJ >= TO_DATE('2010-01-22 14:01:48','YYYY-MM-DD HH24:MI:SS') And FASJ <= TO_DATE('2010-04-22 14:01:48','YYYY-MM-DD HH24:MI:SS') And PCSBM in ('130200000000','130202180000','130202190000')";
Pattern p = Pattern.compile("\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}");
Matcher m = p.matcher(S3);
int index = 0;
while (m.find()){
index++;
System.out.println("INDEX: " + index);
String str1 = m.group();
System.out.println("group: [" + str1 + "]");
}
}
Matcher m = Pattern.compile("\\d{4}-\\d{2}-\\d{2}\\s+\\d{2}:\\d{2}\\d{2}")
.matcher("你的字符串");
while(m.find()){
System.out.println(m.group());
}