/**
*
* @Title: findByIdChengStr
* @Description: TODO
* @author 凯哥Java
* @param editContentStr
* @return
* @return String
* @throws
*/
private String findByIdChengStr(String str,String Vpath) {
String [] pathArr = Vpath.split(",");
String regStr1 = "([\\s\\S]*?)";
Pattern r1 = Pattern.compile(regStr1);
Matcher m1 = r1.matcher(str);
List listBean = new ArrayList();
while(m1.find()){
String oldStr = m1.group(0);
listBean.add(new VoidBean(0,0,null,m1.group(0)));
}
for (int i = 0; i
StringBuilder sbs = new StringBuilder(str);
VoidBean bean = listBean.get(i);
String preStr = bean.getOldStr();
String url = preStr.substring(0,preStr.length()-2);
String beannewStr =pathArr[i];// bean.getNewStr();
String oldStr = bean.getOldStr();
int length = str.indexOf(oldStr);//因为是从开始计数,所以加1
int end = length+url.length()+2;//取得结束位置
String newStr = "
"+beannewStr+"";
sbs.replace(length, end, newStr);
str= sbs.toString();
}
return str;
/**
String regStr = "";
String urlStr = "src=\"([\\s\\S]*?)\"";
Pattern r = Pattern.compile(regStr);
Pattern urlr = Pattern.compile(urlStr);
Matcher m = r.matcher(str);
List listBean = new ArrayList();
while(m.find()){
String oldStr = m.group(0);
// System.out.println("oldStr:"+oldStr);
//
Matcher mUrl = urlr.matcher(oldStr);
if(mUrl.find()){
String url = mUrl.group(0);
// System.out.println("url:"+url);
// src="http://10.10.10.242:82/kaigejava/roadshow/product4.mp4"
url=url.substring(5, url.length()-1);
// System.out.println("处理后的url:"+url);
//处理后的url:http://10.10.10.242:82/kaigejava/roadshow/product4.mp4
listBean.add(new VoidBean(0,0,url,m.group(0)));
}
}
for (int i = 0; i
StringBuilder sbs = new StringBuilder(str);
VoidBean bean = listBean.get(i);
String preStr = bean.getOldStr();
String url = preStr.substring(0,preStr.length()-2);
String beannewStr = bean.getNewStr();
String oldStr = bean.getOldStr();
int length = str.indexOf(oldStr);//因为是从开始计数,所以加1
int end = length+url.length()+2;//取得结束位置
String newStr = "
"+beannewStr+"";
sbs.replace(length, end, newStr);
str= sbs.toString();
}
return str;
**/
}