My GI had a nutritionist who walked me through the FODMAPS diet to identify which sugars were my biggest culprits for gas. Knowing which sugars are worst for me helps me keep a mental tab on what I’m eating and then cut back or take calculated risks as needed/desired.
I also used to buy a digestive enzyme supplement from the health food store. It was kind of pricey but it *claimed* to have a more broad spectrum of enzymes than just Lactaid or Gas-X. Could be worth a try?