本帖最后由 saybookcat 于 2014-05-23 12:41:39 编辑

解决方案 »

  1.   

    你的描述与结果不一致
    <td class="content" id="c_F111029_0" style="color: rgb(0, 0, 0); font-family: 宋体; font-size: 16px;" dbid="DB111">n<table>n<tbody>n<tr>n<td class="content" id="cpp_content_i0" style="color: rgb(0, 0, 0); font-family: 宋体; font-size: 16px;">常用正则表达式大全匹配日期时间
      

  2.   


    没明白规则,这项不符合你说的么
    <td>标签里class="content"的项
    <td class="content" id="c_F111015_0" style="color: rgb(0, 0, 0); font-family: 宋体; font-size: 16px;" dbid="DB111">赞助商广告 </td>
      

  3.   

    感谢楼上两位提出,帖子好像不能修改了 
    截取结果应该是
    <td class="content" id="cpp_content_i0" style="color: rgb(0, 0, 0); font-family: 宋体; font-size: 16px;">常用正则表达式大全匹配日期时间"
      

  4.   

    版主 这样 不合适吧  <td  class="content" 是不是分开作为2个字符比较好呢
      

  5.   


    <script type="text/javascript"> var str = '<td title="GK_PA" class="title" id="t_F111015_0" style="color: rgb(0, 0, 0); font-family: 宋体; font-size: 16px;" dbid="DB111">申请人 - </td>n<td class="content" id="c_F111015_0" style="color: rgb(0, 0, 0); font-family: 宋体; font-size: 16px;" dbid="DB111">赞助商广告 </td></tr>n<tr id="F111152">n<td title="GK_IN" class="title" id="t_F111152_0" style="color: rgb(0, 0, 0); font-family: 宋体; font-size: 16px;" dbid="DB111">名称 - </td>n<td class="content" id="c_F111152_0" style="color: rgb(0, 0, 0); font-family: 宋体; font-size: 16px;" dbid="DB111">附录【所有元字符】附录【所有元字符】</td></tr>n<tr id="F111195">n<td title="GK_IC" class="title" id="t_F111195_0" style="color: rgb(0, 0, 0); font-family: 宋体; font-size: 16px;" dbid="DB111">IPC - </td>n<td class="content" id="c_F111195_0" style="color: rgb(0, 0, 0); font-family: 宋体; font-size: 16px;" dbid="DB111">H04Q7/34</td></tr>n<tr id="F111052">n<td title="GK_TI" class="title" id="t_F111052_0" style="color: rgb(0, 0, 0); font-family: 宋体; font-size: 16px;" dbid="DB111">名称 - </td>n<td class="content" id="c_F111052_0" style="color: rgb(0, 0, 0); font-family: 宋体; font-size: 16px;" dbid="DB111">处理选项</td></tr>n<tr id="F111207">n<td title="GK_ICST" class="title" id="t_F111207_0" style="color: rgb(0, 0, 0); font-family: 宋体; font-size: 16px;" dbid="DB111">ICST - </td>n<td class="content" id="c_F111207_0" style="color: rgb(0, 0, 0); font-family: 宋体; font-size: 16px;" dbid="DB111">H04Q7/34</td></tr>n<tr id="F111029">n<td title="GK_AB" class="title" id="t_F111029_0" style="color: rgb(0, 0, 0); font-family: 宋体; font-size: 16px;" dbid="DB111">摘要 - </td>n<td class="content" id="c_F111029_0" style="color: rgb(0, 0, 0); font-family: 宋体; font-size: 16px;" dbid="DB111">n<table>n<tbody>n<tr>n<td class="content" id="cpp_content_i0" style="color: rgb(0, 0, 0); font-family: 宋体; font-size: 16px;">常用正则表达式大全匹配日期时间"<td>'; var result = str.substr(str.lastIndexOf('<td class="content"'));
    alert(result.substring(0, result.indexOf('<', result.indexOf('<')+1)));
    </script>