Page 1 of 1

extract/ print img and href tags only

Posted: Thu May 14, 2009 8:42 am
by lauthiamkok
Hi,
How can I extract/ print <img src="..."/> and <a href="..."> only from a paragraph of text like the text below,

Code: Select all

<img src="pic1.jpg"/><a href="link1.html">Duis autem </a> vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, <img src="pic2.jpg"/>vel illum dolore eu <a href="link1.html">feugiat</a> nulla facilisis ...
Thanks,
Lau

Re: extract/ print img and href tags only

Posted: Thu May 14, 2009 10:07 am
by socket1
Use RegEx, beyond giving that advice I can't help anymore.