My GI actually told me about carbohydrates being the source of gas. He actually said it, I wish I had the forethought to have a videocamera pointed at him, because I don't think anyone will believe me. Back in 2008 he said it straight out.
The latest problem food for me now is green beans, even cooked, they give me a gassy pain. Safest foods are those with zero starch if this is a problem for you.