Thanks for the question. I would like to say that this can be muscular spasm but important to investigate few important possibilities such as disc disorder in the lumbar-sacral region with nerve compression, electrolyte imbalance, dehydration, blood flow obstruction in the leg. In either case, I will advise to see your physician for complete evaluation & tests in order to establish exact diagnosis. There might be need to have few important tests such as x-ray lower back & leg, fasting blood sugar levels, doppler scan of leg might be needed, serum electrolytes. I will suggest to keep your self well hydrated & take Tab. Motrin for pain relief available OTC. Avoid lifting heavy objects unless seen by physician. Let me know if you have any further question. Best wishes.
Best of luck and keep in touch
Dr. Amir Javed.
This seems to be something more serious & list of important possibilities which I already mentioned above should be investigated ofcourse muscular spasm or pulled hamstring can also give such symptoms but as the pain is there on & off for the last four days so this need to have detail evaluation done by your physician to investigate any nerve compression, electrolyte imbalance, blood flow obstruction or starting symptoms of clot formation & others like that. Let me know if you have any further question. Best wishes.