var a=yinyong
我的yinyong内容是:[url=123]链接[url]
得怎样过滤里面的[url]XXX[url]标签?最好能过滤掉所有。。因为不只是[url],还有[img]...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>new document</title>
<meta name="author" content="XeonWell" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<style type="text/css">
</style>
<script type="text/javascript">
var a = "[url=123]链接[/url]kjk[url=123]链接[/url]jk[img]asdf[/img]";
var re = /\[(.+?)(?:=[^\]]+)?\](.+?)\[\/\1\]/gi;
alert(a.replace(re,"$2"));
</script>
</head>
<body>
</body>
</html>