当前位置: 代码迷 >> C# >> 求正则,取table里面的数据,多谢了
  详细解决方案

求正则,取table里面的数据,多谢了

热度:437   发布时间:2016-05-05 05:31:58.0
求正则,取table里面的数据,谢谢了
<table summary="forum_47" cellspacing="0" cellpadding="0">
<tbody id="stickthread_4038">
<tr>
<td class="icn">
<a href="thread-4038-1-1.html" title="全局置顶主题 - 关闭的主题 - 新窗口打开" target="_blank">
<img src="static/image/common/folder_lock.gif">
</a>
</td>
<th class="lock">
 <a href="thread-4038-1-1.html" style="color: #EE1B2E" onclick="atarget(this)" class="xst">激战双11,关于论坛改动你不得不知的那些事!</a>
<img src="static/image/filetype/image_s.gif" alt="attach_img" title="图片附件" align="absmiddle">
</th>
<td class="by">
<cite>
<a href="space-uid-1.html" c="1" mid="yOpbthgPQWJnEQXJaPYXXOYOLWYaWQEZ">admin</a></cite>
<em><span>2013-11-1</span></em>
</td>
<td class="num"><a href="thread-4038-1-1.html" class="xi2">3</a><em>843</em></td>
<td class="by">
<cite><a href="space-username-19832083.html" c="1" mid="tdmectZGIZHnMPtpSagXXOYOLWYaWQOa">19832083</a></cite>
<em><a href="forum.php?mod=redirect&amp;tid=4038&amp;goto=lastpost#lastpost">2013-11-1 14:37:00</a></em>
</td>
</tr>
</tbody>
<tbody id="stickthread_4038">
<tr>
<td class="icn">
<a href="thread-4038-1-1.html" title="全局置顶主题 - 关闭的主题 - 新窗口打开" target="_blank">
<img src="static/image/common/folder_lock.gif">
</a>
</td>
<th class="lock">
 <a href="thread-4038-1-1.html" style="color: #EE1B2E" onclick="atarget(this)" class="xst">激战双11,关于论坛改动你不得不知的那些事!</a>
<img src="static/image/filetype/image_s.gif" alt="attach_img" title="图片附件" align="absmiddle">
</th>
<td class="by">
<cite>
<a href="space-uid-1.html" c="1" mid="yOpbthgPQWJnEQXJaPYXXOYOLWYaWQEZ">admin</a></cite>
<em><span>2013-11-1</span></em>
</td>
<td class="num"><a href="thread-4038-1-1.html" class="xi2">3</a><em>843</em></td>
<td class="by">
<cite><a href="space-username-19832083.html" c="1" mid="tdmectZGIZHnMPtpSagXXOYOLWYaWQOa">19832083</a></cite>
<em><a href="forum.php?mod=redirect&amp;tid=4038&amp;goto=lastpost#lastpost">2013-11-1 14:37:00</a></em>
</td>
</tr>
</tbody>
</table>



table数据如上
1.需要取出table里面所有的tbody数据
2.然后取出tbody里面 <a href="thread-4038-1-1.html" style="color: #EE1B2E" onclick="atarget(this)" class="xst">激战双11,关于论坛改动你不得不知的那些事!</a> 里面的 href和“激战双11,...” 数据
取出如<a href="space-uid-1.html" c="1" mid="yOpbthgPQWJnEQXJaPYXXOYOLWYaWQEZ">admin</a> 里面的admin
取出 <span>2013-11-1</span> 里面的2013-11-1 麻烦了谢谢


------解决思路----------------------
试一下jumony吧,谁用谁知道
------解决思路----------------------
(?i)(?s)<a href="(?<href>((?!")[\s\S])*)"((?![>])[\s\S])*>(?<content>((?![<>])[\s\S])*)</a
拿去不谢,我是焱
------解决思路----------------------
C#中的jquery,可以使用标准的css选择器选择页面中的元素
------解决思路----------------------
1:(?<=<tbody.*?>).*?(?=</tbody>) 单行
2:(?<=<a.*?>).*?!(?=</a>)
<a\\s?herf="(?"herf".*?)"\\s?style   groups["herf"]  分组
日期(?<=<span>)\\d{4,}-\\d{1,}-\\d{1,}
时间好像好久了
------解决思路----------------------
Hi,as for me, I am testing the related c#.net qr code generator these days. Do you have any ideas about it? Or any good suggestion? I am totally a green hand on qrcode generation in .net field. Any suggestion will be appreciated. Thanks in advance.
  相关解决方案