首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

30分求解-怎么查找网页源码中指定字符

2012-02-02 
30分求解--如何查找网页源码中指定字符例如:查找下面字符中的8888trtdclass f_one ahref profil

30分求解--如何查找网页源码中指定字符
例如:查找下面字符中的   8888

<tr> <td   class= "f_one "> <a   href= "profile.php?action-show-uid-8888.html "> XXXXXXXX </a> </td> </tr>

---------------
最好给出几条代码,解决后立即给分

[解决办法]
我也不熟悉正则,只给你我用过可以得正则

Dim re As RegExp '正则变量
Set re = New RegExp
re.IgnoreCase = True
re.Global = True
re.MultiLine = True
re.Pattern = " <tr> <td class=\ " "f_one\ " "> <a href=\ " "profile.php\?action-show-uid-(.*).html "> XXXXXXXX </a> </td> </tr> " '这里是正则表达式
Dim Match, Matches
Set Matches = re.Execute( "这里是网页文件源码字符串 ")
For Each Match In Matches ' 遍历匹配集合。
Match.SubMatches(0) 就是你要的提取出来的东西了
Next

热点排行