附上链接http://hi.baidu.com/孤单求学/blog/item/ba977360fc78f7c08cb10df2.html原数据 <tr class=listmb3>
 <td colspan=9>
  <table class=displayclass id=result1 onmouseover=hiddenmodify2(1) width=800>
   <tbody>
    <tr id=pr1>
     <td colspan=9>
      <div class=listmb3 style="height: 100%">
       <div style="float: left; width: 41px; height: 100%; text-align: center">mu
        <input id=linecode1 type=hidden value=mu>
       </div>
       <div style="float: left; width: 104px; height: 100%; text-align: center">can </div>
       <div id=aircodelist1 style="float: left; width: 120px; height: 100%; text-align: center" align=center>sha /pvg </div>
       <div style="float: left; overflow: hidden; width: 73px; height: 100%; text-align: center" align=center>所有航班 </div>
       <div id=seatlist1 style="float: left; overflow: hidden; width: 112px; height: 100%; text-align: center" align=center>f </div>
       <div id=commisionlist1 style="float: left; width: 44px; height: 100%; text-align: center" align=center>56% </div>
       <div id=policytypelist1 style="float: left; width: 83px; height: 100%; text-align: center">b2b <img src="/liantuo/images/jipiao/tszc.jpg"></img> </div>
       <div style="float: left; width: 44px; height: 100%; text-align: center">单程 </div>
       <div id=datelist1 style="padding-right: 3px; padding-left: 3px; float: left; padding-bottom: 3px; width: 80px; line-height: 12px; padding-top: 3px; height: 100%; text-align: center">2012-03-07 2012-03-31</div>
       <input id=ptype1 type=hidden value=2>
       <input id=prid_list1 type=hidden value=18719455>
       <div style="width: 80px; text-align: center">
        <div id=otheradd1>
         <input class=button style="width: 60px" onClick="javascript:window.open('/liantuo/manage/publishpolicy.in')" type=button value=添加政策 name=otheraddinput>
        </div>
       </div>
      </div>
     </td>
    </tr>
    <!--隐藏修改-->
    <tr id=update1 style="display: none" valign=top>
     <td id=ceshidiv style="float: left; text-align: center" align=middle colspan=9>
      <input id=agencyidshow1 type=hidden value=83539 name=agencyidshow1>
      <div style="float: left; overflow: hidden; width: 41px; text-align: center">mu</div>
      <div style="float: left; overflow: hidden; width: 104px; text-align: center">can </div>
      <div style="float: left; overflow: hidden; width: 120px; text-align: center">
       <textarea id=upaircodeinput1 onBlur="validatecode('1')"></textarea>
       <div id=upaircode1 style="float: left; width: 120px; height: 100%; text-align: center">sha /pvg </div>
      </div>
      <div style="float: left; overflow: hidden; width: 73px; text-align: center">所有航班 </div>
      <div style="float: left; overflow: hidden; width: 112px; text-align: center">舱位限制
       <input id=beforeseat1 type=hidden value=f name=beforeseat1>
       <div id=showseats1 name="showseats1">f</div>
      </div>
      <div style="float: left; overflow: hidden; width: 94px; text-align: center">本地
       <input class=input_bai id=distributorcommision1 onblur=isdigitcommision(this) onChange="selectinput('1')" size=1 value=56 name=distributorcommision1>
       %平台
       <input id=commoncommision1 onblur=isdigitcommision(this) size=1 value=56 name=commoncommision1>
       %</div>
      <div style="float: left; overflow: hidden; width: 83px; text-align: center">
       <select id=uppolicytype1 style="width: 70px" name=uppolicytype1>
        <option id=bsp1 value=1 selected>bsp</option>
        <option id=b2b1 value=2>b2b</option>
       </select>
      </div>
      <div style="float: left; overflow: hidden; width: 43px; text-align: center">单程 </div>
      <div style="padding-right: 3px; padding-left: 3px; float: right; padding-bottom: 3px; overflow: hidden; width: 122px; padding-top: 3px; text-align: center">从
       <input class=wdate id=upstartdate1 onFocus="wdatepicker({mindate:'%y-%m-#{%d}'})" size=10 value=2012-03-07>
       至
       <input class=wdate id=updepdate1 onFocus="wdatepicker({mindate:'%y-%m-#{%d}'})" size=10 value=2012-03-31>
      </div>
      <input id=prid1 type=hidden value=18719455>
     </td>
    </tr>
    <tr id=display1 style="display: none">
     <td class=listmb3 colspan=9>
      <div id=policycommisionrow>
       <input id=rownumber type=hidden value=1 name=rownumber>
       <input id=seatclassseats type=hidden name=seatclassseats>
       <input id=seatsize1 type=hidden name=seatsize1>
       <div id=checkseat1></div>
      </div>
     </td>
    </tr>
   </tbody>
  </table>
 </td>
</tr> 替换后数据<div style="float: left; width: 41px; height: 100%; text-align: center">mu
        <input id=linecode1 type=hidden value=mu>
       </div>
       <div style="float: left; width: 104px; height: 100%; text-align: center">can </div>
       <div id=aircodelist1 style="float: left; width: 120px; height: 100%; text-align: center" align=center>sha /pvg </div>
       <div style="float: left; overflow: hidden; width: 73px; height: 100%; text-align: center" align=center>所有航班 </div>
       <div id=seatlist1 style="float: left; overflow: hidden; width: 112px; height: 100%; text-align: center" align=center>f </div>
       <div id=commisionlist1 style="float: left; width: 44px; height: 100%; text-align: center" align=center>56% </div>
       <div id=policytypelist1 style="float: left; width: 83px; height: 100%; text-align: center">b2b <img src="/liantuo/images/jipiao/tszc.jpg"></img> </div>
       <div style="float: left; width: 44px; height: 100%; text-align: center">单程 </div>
       <div id=datelist1 style="padding-right: 3px; padding-left: 3px; float: left; padding-bottom: 3px; width: 80px; line-height: 12px; padding-top: 3px; height: 100%; text-align: center">2012-03-07 2012-03-31</div>
       <input id=ptype1 type=hidden value=2>
       <input id=prid_list1 type=hidden value=18719455>
       <div style="width: 80px; text-align: center">
        <div id=otheradd1>
         <input class=button style="width: 60px" onClick="javascript:window.open('/liantuo/manage/publishpolicy.in')" type=button value=添加政策 name=otheraddinput>
        </div>
       </div>求高手帮我写个 表达式... 

解决方案 »

  1.   

    你是想取出:
    <div class=listmb3 style="height: 100%">......</div> 之间的东西?class 属性会改变吗?style 属性会改变吗?如果会改变,这个就没有规则了。如果不改,直接 indexOf 然后截取 substring 就行了。
      

  2.   


    取标签内的数据,  CLASS  这些属性都不会变的
      

  3.   

    xml xPath
    正则讲的很好的,三十分钟 http://manual.phpv.net/regular_expression.html
      

  4.   

    没空看这一大堆乱七八糟的HTML代码