Sharp stitch pain under right rib cage

Hi everyone, I will go to a doctor regarding this but wanted to see if anyone has experienced anything similar and if so what it could be. Every few months I will experience a really intense sharp pain towards the bottom of my right rib cage. It feels a bit like a stitch you would get when walking that just doesn't go away. Last night I felt some discomfort while out and about walking (nothing strenuous) and when I went to bed I couldn't lay on my right hand side without it hurting. Tried lying on my back as well and was a bit better, but when I pressed the area the stitch like pain felt quite bad - a sharp sensation that is hard to describe. I then tried lying on my stomach and couldn't - I wouldn't say the pain was excruciating, but was noticeable enough not to be able to comfortably lay there. It seemed to ease overnight, but still quite tender this morning. Also hurts when I breathe in. I have experienced it in the past but have always put it down to exercise/potentially pulling a muscle at the gym (even though it doesn't really feel like that kind of pain), but have had a break from the gym in recent weeks and it came back again last night. Any info would be much appreciated - I will definitely get it checked out by a doctor, is just hard to find any indication of what it might be without seeing the word cancer splashed everywhere! Thank you