找回密码
 加入
搜索
查看: 3861|回复: 2

[效率算法] 正则出网页某一图片与其名称[已解决]

[复制链接]
发表于 2015-1-13 14:31:05 | 显示全部楼层 |阅读模式
本帖最后由 ghxbs8900 于 2015-1-16 08:34 编辑

小白正则不懂,烦请大神指点!

<ignore_js_op>

<img id="aimg_49" aid="49" src="static/image/common/none.gif"

zoomfile="http://etest.com/201403/21/160659f1v9f9bkfp1qz1mq.jpg"

file=""http://etest.com/201403/21/160659f1v9f9bkfp1qz1mq.jpg" class="zoom"

onclick="zoom(this, this.src, 0, 0, 0)" width="660" id="aimg_49" inpost="1"

onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" />

<div class="tip tip_4 aimg_tip" id="aimg_49_menu" style="position: absolute;

display: none" disautofocus="true">
<div class="xs0">
<p><strong>ab04.jpg</strong> <em class="xg1">
</em></p>
<p>
</p>


</div>
<div class="tip_horn"></div>
</div>

</ignore_js_op>
<br />

<ignore_js_op>

<img id="aimg_50" aid="50" src="static/image/common/none.gif"

zoomfile="http://etest.com/201403/21/160700dt7h3p0dykbkezk0.jpg"

file="http://etest.com/201403/21/160700dt7h3p0dykbkezk0.jpg" class="zoom"

onclick="zoom(this, this.src, 0, 0, 0)" width="660" id="aimg_50" inpost="1"

onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" />

<div class="tip tip_4 aimg_tip" id="aimg_50_menu" style="position: absolute;

display: none" disautofocus="true">
<div class="xs0">
<p><strong>ab05.jpg</strong> <em class="xg1">
</em></p>
<p>
</p>

    名字为ab04.jpg
      名字为ab05.jpg
 楼主| 发表于 2015-1-13 15:18:50 | 显示全部楼层
呃。笨人笨办法。
(?<=zoomfile=").+(?=" file)
发表于 2015-1-13 16:44:55 | 显示全部楼层
本帖最后由 半芯竹 于 2015-1-13 16:59 编辑


#include <Array.au3>
Local $file = FileOpen(@ScriptDir&"\1.txt", 0)
If $file = -1 Then Exit
Local $chars = FileRead($file)
If @error = -1 Then Exit
Local $res = StringRegExp($chars,"[a-zA-z]+://[^\s]*\.jpg|\w+\.jpg(?=\<)",3)
If Not @error Then _arraydisplay($res,'test')
FileClose($file)

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×

评分

参与人数 1金钱 +10 收起 理由
ghxbs8900 + 10 谢谢

查看全部评分

您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-12 02:43 , Processed in 0.094136 second(s), 28 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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