正则出网页某一图片与其名称[已解决]
本帖最后由 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>
如http://etest.com/201403/21/160659f1v9f9bkfp1qz1mq.jpg 名字为ab04.jpg
http://etest.com/201403/21/160700dt7h3p0dykbkezk0.jpg 名字为ab05.jpg 呃。笨人笨办法。(?<=zoomfile=").+(?=" file) 本帖最后由 半芯竹 于 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,"+://[^\s]*\.jpg|\w+\.jpg(?=\<)",3)
If Not @error Then _arraydisplay($res,'test')
FileClose($file)
页:
[1]