Actually, you can check out
Using PerlMonks code to clean up source code that's been printed with <PRE> tags. It's a little script I wrote to make PM code a bit easier to work with. However, you'll want to replace the last regex with the following:
s/<a href="[^"]+">([^<]+)<\/a>/[$1]/g;