All the sugar alcohols, artificial sweeteners, sugars, complex carbohydrates, soluble fiber can cause gas. We can't digest these things (except the sugar), but our gut bacteria can! The artificial sweeteners are bulked with dextrose, etc. I was using a lot of Splenda, have less gas just using table sugar (sucrose) in moderation.
The sugar alcohols, sorbitol, maltitol, etc., are noted for causing diarrhea.