import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class XmlParserUtil {
public static String getResult(String tag,String result){
result=result.replaceAll("<","<").replaceAll(">",">").replaceAll("
","");
Pattern pattern = Pattern.compile("<"+tag+">([\\s\\S]*)</"+tag+">");
Matcher matcher = pattern.matcher(result);
if (matcher.find()) {
result=matcher.group(1);
}else {
throw new RuntimeException("xml解析失败");
}
return result;
}
}