Thank you for your query.
You could be having anal fissure
There are various causes of blood in stools, for which you need to see a Proctologist
However, rectal bleeding
coinciding with periods is suggestive of endometriosis
you should consult a gynecologist for pelvic examination and ultrasound.
If necessary, a laparoscopy is required to confirm the diagnosis.