Two things ...
1) You need to escape parenthesis in any regular expression as they are part of the syntax.
2) Use the third optional argument to ereg() to get the match.
Try this to see what I mean ...
$qid = "901";
$word_map = "901(2), 327(1), 520(8)";
$word_map_word_pulled = ereg($qid."\([0-9]+\)", $word_map, $regs);
echo "<b>".$regs[1]."</b>";