Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 1789|回复: 3

[分享] 有奖练习【正则练习1】

[复制链接]
发表于 2013-8-27 21:53 | 显示全部楼层 |阅读模式
本帖最后由 hwc2ycy 于 2013-8-27 22:39 编辑

练习来源于前几天的作业。
  1. \r\n<td class="icn">\r\n<a href="http://www.aippt.cn/thread-911-1-1.html" title="本版置顶主题 - 新窗口打开" target="_blank">\r\n<img src="static/image/common/pin_1.gif" alt="本版置顶">\r\n</a>\r\n</td>\r\n<th class="common">\r\n <a href="http://www.aippt.cn/thread-911-1-1.html" onclick="atarget(this)" class="xst">OFFICE开发推荐博客</a>\r\n</th>\r\n<td class="by">\r\n\r\n\r\n<span class="pstyle"><a href="http://www.aippt.cn/space-uid-3.html" c="1" target="_blank"><img src="http://www.aippt.cn/uc_server/data/avatar/000/00/00/03_avatar_small.jpg" onerror="this.onerror=null;this.src='http://www.aippt.cn/uc_server/images/noavatar_small.gif'"></a></span>\r\n\r\n<cite>\r\n<a href="http://www.aippt.cn/space-uid-3.html" c="1">儒道佛</a> <a href="http://www.aippt.cn/home.php?mod=spacecp&ac=profile&op=verify&vid=2" target="_blank"><img src="data/attachment/common/c8/common_2_verify_icon.png" class="vm" alt="老师认证" title="老师认证"></a></cite>\r\n<em><span>2011-7-26</span></em>\r\n</td>\r\n<td class="num"><a href="http://www.aippt.cn/thread-911-1-1.html" class="xi2">6</a><em>949</em></td>\r\n<td class="by">\r\n<cite><a href="http://www.aippt.cn/space-username-XUCG.html" c="1">XUCG</a></cite>\r\n<em><a href="http://www.aippt.cn/forum.php?mod=redirect&tid=911&goto=lastpost#lastpost">2012-8-29 23:02</a></em>\r\n</td>\r\n"
  2.                
  3. \r\n<td> </td>\r\n<th><a href="javascript:;" onclick="checkForumnew_btn('193')" title="查看更新" class="forumrefresh">版块主题</a></th><td> </td><td> </td><td> </td>\r\n
  4.                
  5. \r\n<td class="icn">\r\n<a href="http://www.aippt.cn/thread-16855-1-1.html" title="有新回复 - 新窗口打开" target="_blank">\r\n<img src="static/image/common/folder_new.gif">\r\n</a>\r\n</td>\r\n<th class="new">\r\n <a href="http://www.aippt.cn/thread-16855-1-1.html" onclick="atarget(this)" class="xst">求助:统计所有幻灯片动作效果(VBA代码)</a>\r\n<img src="static/image/stamp/011.small.gif" alt="新人帖" align="absmiddle">\r\n<img src="static/image/filetype/common.gif" alt="attachment" title="附件" align="absmiddle">\r\n<a href="http://www.aippt.cn/forum.php?mod=redirect&tid=16855&goto=lastpost#lastpost" class="xi1">New</a>\r\n</th>\r\n<td class="by">\r\n\r\n\r\n<span class="pstyle"><a href="http://www.aippt.cn/space-uid-12026.html" c="1" target="_blank"><img src="http://www.aippt.cn/uc_server/data/avatar/000/01/20/26_avatar_small.jpg" onerror="this.onerror=null;this.src='http://www.aippt.cn/uc_server/images/noavatar_small.gif'"></a></span>\r\n\r\n<cite>\r\n<a href="http://www.aippt.cn/space-uid-12026.html" c="1">banjinjiu</a></cite>\r\n<em><span class="xi1"><span title="2013-8-26">2 小时前</span></span></em>\r\n</td>\r\n<td class="num"><a href="http://www.aippt.cn/thread-16855-1-1.html" class="xi2">1</a><em>5</em></td>\r\n<td class="by">\r\n<cite><a href="http://www.aippt.cn/space-username-banjinjiu.html" c="1">banjinjiu</a></cite>\r\n<em><a href="http://www.aippt.cn/forum.php?mod=redirect&tid=16855&goto=lastpost#lastpost"><span title="2013-8-26 21:13">2 小时前</span></a></em>\r\n</td>\r\n
复制代码
有一段如上文本,要求提取出贴子的链接,标题,发贴人,发贴时间
要求用正则提取,前十名答对者有BB奖励。规则最短者奖前三名分别奖励30BB,20BB,10BB,其余七名答对者一律5BB。
效果如下图:
QQ截图20130827215023.jpg

跟贴只需提交规则即可。

实际测试的文本只取了网页代码中有代表性的二种,要求就用一条正则规则来实现。效果图是完全的网页代码中取出来的,做题的时候只要关注网页标题有的那两条就成了。

另外,要求提取的值方便写入单元格,可提供完整代码。


excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
 楼主| 发表于 2013-8-27 22:39 | 显示全部楼层

使用道具 举报

发表于 2013-8-28 11:50 | 显示全部楼层

使用道具 举报

发表于 2013-8-28 11:51 | 显示全部楼层
此帖仅作者可见

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-5-4 02:33 , Processed in 0.577839 second(s), 16 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表