1. 程式人生 > >正則表示式匹配兩個指定字串中間的內容

正則表示式匹配兩個指定字串中間的內容

public static List<String> getSubUtil(String soap,String rgex){
    List<String> list = new ArrayList<String>();
    Pattern pattern =  = Pattern.compilepile(rgex);// 匹配的模式
    Matcher m =  = pattern.matcher(soa(soap);
    while (e (m.find()) ()) {
        int i = 1;
           list.add(m.g(dd(m.group(i))(i));
        i++;
    }
    return list;
}

String str1 = "";
String rgex = "src=(.*?)x-oss-process";
System.out.println(get(getSubUtil(str1,rgex));