<script>
var str = "<table width=\"100\" height=\"100\" >";
if (!str.match(/<table.+(border).+>/))
alert("匹配");
</script>
var str = "<table width=\"100\" height=\"100\" >";
if (!str.match(/<table.+(border).+>/))
alert("匹配");
</script>
<table width="1">
<table width="2">
......
<table width="1000000000000000000000000000">也可能是
<table width=1>
......
<table width=10000000000000000000000000000>还有可能是
<table width='1'>
......
<table width='10000000000000000000000000000'>更有可能是
<table.....width=1......height=1......cellpadding=1 ......cellsapcing=1....>
可能的情况实在太多了
var str = "<table width=\"100\" height=\"100\" >";
if (!str.match(/<table.+(border).+>/))
alert(str.replace("<table", "<table border=1"));
</script>
甚至,某些人为了做出渐变色的border,不惜用图片来实现