I've been working on making a regex to replace links in data.
$data = ereg_replace("<a([^href]*)href=['|\"]([^'|^\"]+)['|\"]([^>]*)>([^<]+)</a>", "<a\\1href=\"tracker.php?u=\\2\"\\3>\\4</a>", $data);
Solution found! The code above will work if anyone else is ever looking for such a solution.
Guess I forgot to add in that 'href'. Woops. Sorry!