首页
社区
课程
招聘
[旧帖] [求助]如何正则匹配以下的HTML的数据按表格里的分值从大到小排序 0.00雪花
发表于: 2011-6-28 00:21 1242

[旧帖] [求助]如何正则匹配以下的HTML的数据按表格里的分值从大到小排序 0.00雪花

2011-6-28 00:21
1242
<table width=100% border=0 cellpadding=0 cellspacing=0><tr>
  <td width=55 valign=center><img title='Member clicks: 70 - Visitor clicks: 22 - Total clicks: 92' id='ad_236_1' src='/themes/68/classic/images/icon_clickads.png' height=39 width=45></td>
  <td id='ad_236_4' valign=top style='border:1px solid white;' onmouseover='adm(236,1);' onmouseout='adm(236,0);'>
  <div id='ad_236_2' style='padding:5px; background:white; cursor:pointer;' onclick='openad("20110624fa93c1e2bc807957e995173e6c8632ec");'>
  <div style='height:50px;'>
  <div id='ad_236_3' style='font-weight:bold; color:#555555;'>If You Love PapaBux, You'll Love EZClikz</div>
  <span class='small disabled'>Wonderful Admin - High RR Click Rate!</span>

  </div>
  </div>
  </td>
  <td valign=center width=95>
  <div style='margin-left:10px;'>
  <center>
  <table cellpadding=0 cellspacing=0 style='margin:0px;'><tr><td width=16 style='padding:0px; border:0px solid white;'><span ><span class='membershipicon membershipicon_membershipID_4' title='Papa'></span></span></td><td width=16 style='padding:0px; border:0px solid white;'><span ><span class='membershipicon membershipicon_membershipID_3' title='Mama'></span></span></td><td width=16 style='padding:0px; border:0px solid white;'><span style='visibility:hidden;'><span class='membershipicon membershipicon_membershipID_2' title='Kid'></span></span></td><td width=16 style='padding:0px; border:0px solid white;'><span style='visibility:hidden;'><span class='membershipicon membershipicon_membershipID_1' title='New Born'></span></span></td></tr></table>
  <br class=br5>
  <div class=strike title='Referral click: $0.0010'><span class=currency >$</span>0.01</div>

  <div class='small disabled' style='text-align:center;'>30 sec</div>
  </center>
  </div>
  </td>
  </tr></table>
  </div></div>
  <div style='font-size:1px; float:right; width:5px; height:5px; background:url("/images/icon_circlegray.gif") bottom right;'> </div>
  <div style='font-size:1px; float:left; width:5px; height:5px; background:url("/images/icon_circlegray.gif") bottom left;'> </div>

  <div style='font-size:1px; height:5px;'> </div>
  </div>
  <br></div><div id=adwrapper_238>
  <div style='background:#F0F0F0; '>
  <div style='font-size:1px; float:right; width:5px; height:5px; background:url("/images/icon_circlegray.gif") top right;'> </div>
  <div style='font-size:1px; float:left; width:5px; height:5px; background:url("/images/icon_circlegray.gif") top left;'> </div>
  <div style='font-size:1px; height:5px;'> </div>
  <div style='padding:0px 10px;'><div style='width:100%;'>
  <table width=100% border=0 cellpadding=0 cellspacing=0><tr>

  <td width=55 valign=center><img title='Member clicks: 1012 - Visitor clicks: 13 - Total clicks: 1025' id='ad_238_1' src='/themes/68/classic/images/icon_clickads.png' height=39 width=45></td>
  <td id='ad_238_4' valign=top style='border:1px solid white;' onmouseover='adm(238,1);' onmouseout='adm(238,0);'>
  <div id='ad_238_2' style='padding:5px; background:white; cursor:pointer;' onclick='openad("20110624ef0972b708a690f672287a4f467b3681");'>
  <div style='height:50px;'>
  <div id='ad_238_3' style='font-weight:bold; color:#555555;'>BUXEVER - All Payouts INSTANT</div>
  <span class='small disabled'>You Can Buy Referrals - Up to $0.02 per Click</span>
  </div>
  </div>

  </td>
  <td valign=center width=95>
  <div style='margin-left:10px;'>
  <center>
  <table cellpadding=0 cellspacing=0 style='margin:0px;'><tr><td width=16 style='padding:0px; border:0px solid white;'><span ><span class='membershipicon membershipicon_membershipID_4' title='Papa'></span></span></td><td width=16 style='padding:0px; border:0px solid white;'><span ><span class='membershipicon membershipicon_membershipID_3' title='Mama'></span></span></td><td width=16 style='padding:0px; border:0px solid white;'><span ><span class='membershipicon membershipicon_membershipID_2' title='Kid'></span></span></td><td width=16 style='padding:0px; border:0px solid white;'><span ><span class='membershipicon membershipicon_membershipID_1' title='New Born'></span></span></td></tr></table>
  <br class=br5>
  <div class=strike title='Referral click: $0.0003'><span class=currency >$</span>0.0030</div>
  <div class='small disabled' style='text-align:center;'>10 sec</div>

  </center>
  </div>
  </td>
  </tr></table>
--------------------------------------------------------------------------------------
1。从以上HTML通过正则匹配获取想要数据onclick='openad("20110624ef0972b708a690f672287a4f467b3681")括号里的字符
2。获取的数据对应同行表格的分值$</span>0.0030</div>、$</span>0.01</div>等分值进行从大到小排序
(简单的说就是同时匹配A和B。通过B的分值大小决定A对应的排序位置,从而得到A的新排序列表)

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (2)
雪    币: 1
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
帮楼主顶下帖,本人解答不了,能力有限
2011-6-28 01:12
0
雪    币: 6
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
没听懂你的意思。可以加我QQ:1355568001 注(正则表达式)
2011-10-25 15:01
0
游客
登录 | 注册 方可回帖
返回
//