(<body\s*|\w*>)(.*?)(<\/body>)

解决方案 »

  1.   

    试试
    <body\s*|\w*>)(\s|\S)*(<\/body>
      

  2.   

    (<body\s*\w*>)(.*?)(<\/body>)
      

  3.   

    str.match(/<body[^>]*>(.+?)<\/body>/gim);
      

  4.   

    ^(<body\s*|\w*>)(.*?)(<\/body>)$ 注意大小写....
      

  5.   

    <html>

    <script language="javascript">
    function fly(){
          strBody=document.body.outerHTML
            alert(strBody.match(/<body>(.|\n)*<\/body>/ig))
    }
     </script>
       <body> 
     <input type=button value="飞天给你正解" onclick=fly() >
     <table width="87%" border="1" cellspacing="0" cellpadding="0" align="" style="margin-left:10" ID="Table1">
    <thead>
    <tr class=row1tr> 
      <td>Select</td>
      <td>Coverage Period</td>
      <td>From Date<br>(DD/MM/YYYY)</td>
      <td>To Date<br>(DD/MM/YYYY)</td>
    </tr>
    </thead>
    <tbody id="DataTable">
    <tr ack="update" old_period="1" cannotDel=""  firstPRrow="false"  lastPRrow="false">
    <td align=center><input type="radio" name="select" ID="Radio1" VALUE="Radio1"></td>
    <td align=center>1</td>
    <td align=center nowrap><input type=text value="1" size=2  style='text-align:right;background-color:menu' readonly maxlength=2 ID="Text1" NAME="Text1">/<input type=text value="1" size=2 style='text-align:right;background-color:menu' readonly maxlength=2 ID="Text2" NAME="Text2">/<input type=text value="2004" size=4 style='text-align:right;background-color:menu' readonly maxlength=4 ID="Text3" NAME="Text3"></td>
    <td align=center nowrap><input type=text onchange="changeDate(this)" value="31" size=2 style='text-align:right'   maxlength=2 ID="Text4" NAME="Text4">/<input type=text onchange="changeDate(this)" value="3" size=2 style='text-align:right' maxlength=2 ID="Text5" NAME="Text5">/<input type=text onchange="changeDate(this)" value="2004" size=4 style='text-align:right'  maxlength=4 ID="Text6" NAME="Text6"></td>
    </tr>
    <tr ack="update" old_period="2" cannotDel=""  firstPRrow="false"  lastPRrow="false">
    <td align=center><input type="radio" name="select" ID="Radio2" VALUE="Radio2"></td>
    <td align=center>2</td>
    <td align=center nowrap><input type=text value="1" size=2  style='text-align:right;background-color:menu' readonly maxlength=2 ID="Text7" NAME="Text7">/<input type=text value="4" size=2 style='text-align:right;background-color:menu' readonly maxlength=2 ID="Text8" NAME="Text8">/<input type=text value="2004" size=4 style='text-align:right;background-color:menu' readonly maxlength=4 ID="Text9" NAME="Text9"></td>
    <td align=center nowrap><input type=text onchange="changeDate(this)" value="30" size=2 style='text-align:right'   maxlength=2 ID="Text10" NAME="Text10">/<input type=text onchange="changeDate(this)" value="6" size=2 style='text-align:right' maxlength=2 ID="Text11" NAME="Text11">/<input type=text onchange="changeDate(this)" value="2004" size=4 style='text-align:right'  maxlength=4 ID="Text12" NAME="Text12"></td>
    </tr>
      </tbody>
    </table>
    </body>
    </html>
      

  6.   

    /<body>(.|\n)*<\/body>/ig
      

  7.   

    如果body有属性就:
    /<body.*>(.|\n)*<\/body>/ig