日期:2014-05-16 浏览次数:20402 次
var s = "some str1<a href='www.baidu.com'>baidu</a>some str2<a href='www.qq.com'>tencent</a>some str3";
s = s.replace(/<a href='(.+?)'>(.+?)<\/a>/g,"$2")
alert(s);
var s = "some str1<a href='www.baidu.com'>baidu</a>some str2<a href='www.qq.com'>tencent</a>some str3";
s = s.replace(/<a href='(.+?)'>(.+?)<\/a>/g,"[ url=$1 ]$2[ /url ]")
alert(s);