复制代码 代码如下:
<textarea id="txt">
<table border=1 width="20%">
<tr><th>title</th><th>title2</th></tr>
<tr rs="{id:\'section006\'}"><td>data1</td><td>data2 </td>
</tr>
<tr ><td>data1</td><td>data2</td></tr>
</table>
</textarea>
<script>
var str = document.getElementById('txt').value;
alert(str);
</script>
/<tr[^>]*>[\s\S]*?<\/tr>/gi,