代码如下:
使用正则表达式分别取出“type:a;”和“type:b;”。public class Test { public static void main(String[] args){
String path = "type: a; path: b;";
Pattern c = Pattern.compile(".*;");
Matcher matcher = c.matcher(path);
while(matcher.find()){
System.out.println(matcher.group());
}

}
}