You don't seem to be allowing any content between the <a> and </a>. I think you need (.*) in there (it should be a replacement group because it's what you want to keep), and the matching to be done non-greedily.
Also, you don't allow for multiple <a> inside the same <pre>.
I don't really think regex is the right tool for this job, as there's lots of context and state-change in what you're trying to do. An XML based solution seems better to me. But something like
... in non-greedy mode and writing all the found groups into the output might work.
Sometimes it makes sense to split the problem up. Rather than attempting to grab the pre tags that contain a tags, why not grab the pre tags and then iterate over them - and do a second regex for the a tag. That way, you have the full context without worrying about backtracking.
*pre-emptive celebratory nipple tassle jiggle* - Sean Ewington