What you're describing is called a low FODMAP diet. A family member has tried this diet for about a month to great success. They were fine for the last 1-2 years and then ate a coconut yogurt and the symptoms came back. They are back on the low FODMAP diet again and things have gotten better but they have like two to three more weeks before they are on their normal diet again.
You’re actually not supposed to do it permanently. The idea is eliminate, then work back in each of the six different sugars in small quantities to see what is tolerated.
If you’re zero fodmap for years you lose all the bacteria that digest them and are left even more susceptible.