From the time he was 2 weeks old, I noticed that my son had horrible colic 5-10 hours after I ate dairy. He can't tolerate any dairy or eggs, which sucks because I love those foods. But the sacrifice is well worth it, and since I've stopped eating all the culprits, he's now gas-free at 8.5 weeks old (usually this is the age when colic tends to flare up).
Be careful with soy products too, because they sometimes add milk protein to them, and I read that it's the milk protein that babies have trouble with, not necessarily the lactose.
The good news is that once their tummies become more developed, we can slowly add back these foods.