You're almost there, just don't add the ^
and $
anchors. And the uppercase A-F
range isn't even necessary since Express seems to match case-insensitive:
app.post('/:mongoId([0-9a-f]{24})', function(req, res){
var id = req.param('mongoId');
...
});