<script>
function check()
{
var str1 = document.getElementById("TextInput").value;
document.getElementById("Text2").value =  str1.replace(/(\<\s*a[\d\D]+?\>\s*)(href)(\:[\d\D]*\<\/a>)/ig,function(a,b,c,d){return (b+"链接"+d)});
}
</script>
</head><body><form method="post">
<textarea name="Text1" id="TextInput" value="asdfasdfadsadsaadfdfasdfwefwefwefaafewef" style="width:600px; height:100px;">
<a href="http://www.btut2004.com">href:http://www.btut2004.com/</a>
</textarea>
<br/><input name="Button1" type="button" value="按钮" onclick="check()" />
</form>
<textarea name="Text2" id="TextInput2" style="width:600px; height:100px;"></textarea>
</body></html>