1
我如何提取src
嵌入標籤的屬性與正則表達式?我怎樣才能提取src屬性嵌入標籤
在這個例子中(YouTube視頻):
<div dir="" class="ms-rtestate-field">
<div class="ExternalClass082784C969B644B096E1F293CB4A43C5">
<p>
<object width="480" height="385">
<param name="movie" value="http://www.youtube.com/v/Ora35AzLxt0?fs=1&amp;hl=fr_FR"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/Ora35AzLxt0?fs=1&amp;hl=fr_FR" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed>
</object>
</p>
</div>
</div>
我只能提取與此正則表達式的完整標籤:
<embed>*(.*?)</embed>
結果:
<embed src="http://www.youtube.com/v/Ora35AzLxt0?fs=1&amp;hl=fr_FR" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed>
是有可能只獲得src
屬性的值?
謝謝!
yeahhh,非常感謝! – Christian 2010-09-30 15:26:53