I had the same problem. It's generally related to stomach issues. The five most common allergens according to my pediatrician are nuts, dairy, soy, eggs and wheat. It sucks, but I went on an elmination diet (except for the wheat, just couldn't cut that one out). So, cut out what you think the culprits might be (most often, dairy or nuts) and don't eat them for a full week and see if there is improvement. After a week, you can reintroduce stuff you eliminated about every 3 days. Note that what made it hard for us to figure out the problem was it took about 1.5 days after I started eating something again for him to react, so I'd eat dairy and he'd be fine that day and then the next he'd blow up but I'd be thinking it wasn't the dairy because I'd had it the day before and he was fine. Anyway, after I did the elimination diet, he was fine, then I started back on eggs and soy, no problem, then milk, and a day later he was screaming (really scary screaming, in total pain). I cut out the milk and nuts and he went from a constantly crying baby to a totally happy baby. You don't have to cut this out forever, their digestive system really matures starting around 6 months. My boy is now 7 months and I can eat dairy again and he even has yogurt, but till about 6 months, I had to cut it out, and if we gave him a formula supplement it had to be soy formula.
Other possibilities are lactose intolerance but not milk allergy (would need to give him lactaid drops before feeding -- we tried this but it wasn't the issue), or, if you're on formula, there is some hypoallergenic type but it tastes and smells bad (though you could try it for a week and if he improves, you know it's definitely digestion related).
Good luck. FYI, "colic" is the doctor's term for "we don't know what's wrong with your baby."