日期:2014-05-20 浏览次数:20749 次
String jarString = "CLASSPATH=${RUNTIME}/app.jar:${RUNTIME}/site.jar:${RUNTIME}/dbgen.jar";
public static void main(String[] arg) {
List<String> imgList = new ArrayList<String>();
String intputStr ="CLASSPATH=${RUNTIME}/app.jar:${RUNTIME}/site.jar:${RUNTIME}/dbgen.jar";
Pattern pattern = Pattern.compile("/.+?(.jar)");
Matcher matcher = pattern.matcher(intputStr);
while (matcher.find()) {
imgList.add(matcher.group(0).replace("/", ""));
}
System.out.println(imgList);
}
public static void main(String[] arg) {
List<String> imgList = new ArrayList<String>();
String intputStr ="CLASSPATH=${RUNTIME}/app.jar:${RUNTIME}/site.jar:${RUNTIME}/dbgen.jar";
Pattern pattern = Pattern.compile("/(.+?(.jar))");
Matcher matcher = pattern.matcher(intputStr);
while (matcher.find()) {
imgList.add(matcher.group(1));
}
System.out.println(imgList);
}