Heh... it's as easy as a simple [man]preg_match_all/man function call.
Pattern:
"~<a href=\"([\"])\"[>]>(.*)</a>~"
It may need some tweaking, but it should work. The basic idea is this:
Find a part of the string that starts with "<a href="". now, take any character before another quote. And any other information about the link (target, style, class, etc.) before the closing ">". Then, take anything before you get to "</a>".
The negates the class. So [>] allows only ">" while, [>] allows anything but a greater than symbol.