I've got exactly the same injury in my left quad/hip flexor. It primary hurts on the upstroke, when riding with power or climbing a hill; and is really bothersome after a half hour. My background, a bit older now (57) but very seasoned cyclist. I just pulled something in my leg stepping up onto a 2' ledge this fall, something I should be able to do effortlessly. I didn't take it seriously at 1st, as at my age pretty much everything hurts anyway. But after returning after a complete stop for a month (for other reasons) I found now improvement at all; if not slightly worse. In reading, I've found this can be a common injury for cyclist due the repetitive nature of cycling; I probably had it coming on before I tore something on my step-up.
I haven't seen a doctor as I think the strain isn't so acute as to require surgery, so they would only prescribe PT. So I looked up PT for quad strains; pretty much gentle stretching of the glute (not so much the quad), with butt bridges, side leg raises, clam shells, donkey kicks (carefully; those pull my quad some). As winter is upon me now, also will be moving indoor to the trainer & can keep power down for lower intensity sessions.
A week into this; no change in my quad but interestingly the knee pain I've been having all year as all but completely vanished. However, it normally takes a month or two for PT to make a difference; so I'm going to stick with this for the winter.
That's my plan anyway; good luck