Click to See Complete Forum and Search --> : strip out anchor tag info?


krisdb
11-05-2006, 03:49 PM
Is it possible to strip out just the anchor tag information from a string? So if I have a large string of text, with different HTML tags interspersed, can I capture the anchor tag link and text? So if the anchor tag is:

<a href="http://www.server.com/page.asp">some text</a>

can I capture 'http://www.server.com/page.asp' and 'some text' into variables? What if there a multiple anchor tags?

Thanks.

so_is_this
11-05-2006, 06:43 PM
This Regular Expression string will allow you to remove all anchor tags:
/<a\s+[^>]*>[^<]*<\/a>/g