seniors 发表于 2011-8-10 16:00:35

求助:正则提取网页内容[已解决]

本帖最后由 seniors 于 2011-8-10 20:35 编辑

<li>
<div class="slxhl"></div>
<div class="slmc"><a href="LRC/2005-12-10-JNCNHMIRGOOJNIOFPHSDRC-45715.htm" target=_blank>月亮代表我的心</a></div>
<div class="acll"><a href="so.asp?y=2&key=%C1%F5%EE%B8">刘罡</A></div>
<div class="acrr"><a href="so.asp?y=3&key=%BE%FD%D4%D9%C0%B4">君再来</A></div>
<div class="slcz"><a href="LRC/2005-12-10-JNCNHMIRGOOJNIOFPHSDRC-45715.htm" target=_blank>试听</A></div>
<div class="slcz"><a href="sms.html?key=%D4%C2%C1%C1%B4%FA%B1%ED%CE%D2%B5%C4%D0%C4" target=_blank>铃声</A></div>
<div class="slczt"><a href="http://mp3.baidu.com/m?f=ms&rn=&tn=baidump3&ct=134217728&word=%D4%C2%C1%C1%B4%FA%B1%ED%CE%D2%B5%C4%D0%C4+%C1%F5%EE%B8&lm=-1" target=_blank><img border=0 src=img/down.gif width=16 height=16></A></div>
<div class="slczt"><ahref="lrc_db/2005-12-10-JNCNHMIRGOOJNIOFPHSDRC-45715.lrc" target=_blank>下载LRC</A></div>
</li>
<li>
<div class="slxhl"></div>
<div class="slmc"><a href="LRC/2001-5-13-JMQRLNIPQNOJNMOJOEOO-3571.htm" target=_blank>月亮代表我的心</a></div>
<div class="acll"><a href="so.asp?y=2&key=%C6%EB%C7%D8">齐秦</A></div>
<div class="acrr">&nbsp;</div>
<div class="slcz"><a href="LRC/2001-5-13-JMQRLNIPQNOJNMOJOEOO-3571.htm" target=_blank>试听</A></div>
<div class="slcz"><a href="sms.html?key=%D4%C2%C1%C1%B4%FA%B1%ED%CE%D2%B5%C4%D0%C4" target=_blank>铃声</A></div>
<div class="slczt"><a href="http://mp3.baidu.com/m?f=ms&rn=&tn=baidump3&ct=134217728&word=%D4%C2%C1%C1%B4%FA%B1%ED%CE%D2%B5%C4%D0%C4+%C6%EB%C7%D8&lm=-1" target=_blank><img border=0 src=img/down.gif width=16 height=16></A></div>
<div class="slczt"><ahref="lrc_db/2001-5-13-JMQRLNIPQNOJNMOJOEOO-3571.lrc" target=_blank>下载LRC</A></div>
</li>
<li>
<div class="slxhl"></div>
<div class="slmc"><a href="LRC/2005-12-10-JNCNHMIRGOOJNJQMQEMNQG-47164.htm" target=_blank>月亮代表我的心</a></div>
<div class="acll"><a href="so.asp?y=2&key=%C3%CE%D6%AE%C2%C3%BA%CF%B3%AA%D7%E9%BA%CF">梦之旅合唱组合</A></div>
<div class="acrr"><a href="so.asp?y=3&key=%C1%F7%CC%CA%B5%C4%B8%E8%C9%F9%D6%AE%D5%E6%C7%E9%D2%C0%BE%C9+%28%C8%FD%29">流淌的歌声之真情依旧 (三)</A></div>
<div class="slcz"><a href="LRC/2005-12-10-JNCNHMIRGOOJNJQMQEMNQG-47164.htm" target=_blank>试听</A></div>
<div class="slcz"><a href="sms.html?key=%D4%C2%C1%C1%B4%FA%B1%ED%CE%D2%B5%C4%D0%C4" target=_blank>铃声</A></div>
<div class="slczt"><a href="http://mp3.baidu.com/m?f=ms&rn=&tn=baidump3&ct=134217728&word=%D4%C2%C1%C1%B4%FA%B1%ED%CE%D2%B5%C4%D0%C4+%C3%CE%D6%AE%C2%C3%BA%CF%B3%AA%D7%E9%BA%CF&lm=-1" target=_blank><img border=0 src=img/down.gif width=16 height=16></A></div>
<div class="slczt"><ahref="lrc_db/2005-12-10-JNCNHMIRGOOJNJQMQEMNQG-47164.lrc" target=_blank>下载LRC</A></div>
</li>
<li>
<div class="slxhl"></div>
<div class="slmc"><a href="LRC/2005-12-11-JNCNHMQRLQIJNMRHOGOHPM-50254.htm" target=_blank>月亮代表我的心</a></div>
<div class="acll"><a href="so.asp?y=2&key=%C7%E0%D1%E0%D7%D3%D1%DD%B3%AA%D7%E9">青燕子演唱组</A></div>
<div class="acrr">&nbsp;</div>
<div class="slcz"><a href="LRC/2005-12-11-JNCNHMQRLQIJNMRHOGOHPM-50254.htm" target=_blank>试听</A></div>
<div class="slcz"><a href="sms.html?key=%D4%C2%C1%C1%B4%FA%B1%ED%CE%D2%B5%C4%D0%C4" target=_blank>铃声</A></div>
<div class="slczt"><a href="http://mp3.baidu.com/m?f=ms&rn=&tn=baidump3&ct=134217728&word=%D4%C2%C1%C1%B4%FA%B1%ED%CE%D2%B5%C4%D0%C4+%C7%E0%D1%E0%D7%D3%D1%DD%B3%AA%D7%E9&lm=-1" target=_blank><img border=0 src=img/down.gif width=16 height=16></A></div>
<div class="slczt"><ahref="lrc_db/2005-12-11-JNCNHMQRLQIJNMRHOGOHPM-50254.lrc" target=_blank>下载LRC</A></div>
</li>
月亮代表我的心   刘罡   lrc_db/2005-12-10-JNCNHMIRGOOJNIOFPHSDRC-45715.lrc
月亮代表我的心   齐秦   lrc_db/2001-5-13-JMQRLNIPQNOJNMOJOEOO-3571.lrc
月亮代表我的心   梦之旅合唱组合   lrc_db/2005-12-10-JNCNHMIRGOOJNJQMQEMNQG-47164.lrc
月亮代表我的心   青燕子演唱组   lrc_db/2005-12-11-JNCNHMQRLQIJNMRHOGOHPM-50254.lrc

我要上面这些内容,正则高手帮下忙

papapa314 发表于 2011-8-10 16:24:06

StringRegExp($sourse,'"lrc_db.+?"',3)
StringRegExp($sourse,'target=_blank>(.+?)</a></div>',3)
StringRegExp($sourse,'href=".+y=2.+">(.+)</A></div>',3)

minterz 发表于 2011-8-10 16:34:00

用好_StringBetween
简单易懂,会少很多正则烦恼.

taliove 发表于 2011-8-10 19:01:08

回复 2# papapa314


    学习了。。怎么总感觉 au3 的正则和code architects regex Tester 不一样。
页: [1]
查看完整版本: 求助:正则提取网页内容[已解决]