This may be stupid

But how do you tell gas pains from contractions? I am getting waves of sharp belly pain (sometimes accompanied with back pain). It could be either I think.