You can eat what you want, but it is your stomach that will disagree. Eat foods that are a bit more bland, not spicy, no vinegars, stuff that will be harsh on your stomach and the acids therein. If you have seen a doctor for this, you should have gotten some medicine to help get rid of them, or at least to get rid of the upset stomach. If you haven't been to the doctor, you should really go, because a regular ulcer can lead to a bleeding ulcer, and if that is let go, there is a chance that they vein can burst, and then you will be in a big amount of trouble. Hope this helps, good luck to you.
This will sound very weird but unripe bananas are proven to help with stomach ulcers. Also lots of vitamin A and C. Carrots, oranges, that sort of thing. Its nothing about the color of the fruit or veggie, they are just good examples