String a = "<a href=/"
http://www.dd.com/1.mp3/">http://wds.mp3</a>";
String re = "< //s*a//s+href//s*=//s*/"|//s*/"//s*>|<(.[^>]*)>"; //取地址和中文
String regex = "< //s*a//s+href//s*=//s*/"|//s*/"//s*>"; //取地址
String reg = "<(.[^>]*)>"; //取中文
Pattern p = Pattern.compile(re);
Matcher math = p.matcher(a);
StringBuffer bs = new StringBuffer();
boolean b = math.find();
while (b) {
math.appendReplacement(bs, "");
b = math.find();
}
math.appendTail(bs);
System.out.println(bs);
String re = "< //s*a//s+href//s*=//s*/"|//s*/"//s*>|<(.[^>]*)>"; //取地址和中文
String regex = "< //s*a//s+href//s*=//s*/"|//s*/"//s*>"; //取地址
String reg = "<(.[^>]*)>"; //取中文
Pattern p = Pattern.compile(re);
Matcher math = p.matcher(a);
StringBuffer bs = new StringBuffer();
boolean b = math.find();
while (b) {
math.appendReplacement(bs, "");
b = math.find();
}
math.appendTail(bs);
System.out.println(bs);