Any sharp pain in the abdomen can be due to
gas, threatened abortion, infection or due to unrelated
causes such as kidney or gall bladder stones.
In your case since it has been happening for last so many weeks, it must be gas. Watch what you eat and keep a log and see if what you eat is related to the appearance of pain. Some food items cause more gas formation than others. Take care!