Hello,
That is a good question indeed! I have done a specific diet in the past, called the Low FODMAP diet, to identify any food that might be linked to my IBS symptoms. I did not find any particular food that would trigger a flare, but for me it's more about the load of these types of food high in FODMAP that would make me having a episode.
Since then, I watch the amount of carb I eat every day, and avoid white bread, plain pasta and potatoes. I go for wholegrain carbs, eat wholemeal bread and brown pasta. Generally, eating rice, quinoa is a safest option for me. That means I can still enjoy some carbs 😀