in reply to extracting link *and* tag content from "a href"

<A HREF=?ad=049>One</A> <A HREF=?ad=050>Two</A>
This isn't HTML, so you might have problems with standard HTML parsers. In fact, I'd hope to never run across a page that looks like that.

Standard acceptable HTML will need to quote those attribute values.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.