。
She regrets having failed the exam.
Literal
She [topic-は] exam [target-に] failed thing [object-を] is-regretting.
The nominalizer こと turns the past clause 試験に失敗した ('failed the exam') into a noun phrase, which を then marks as the object of 悔やむ ('to regret, lament'). 悔やむ is a slightly more literary verb than 後悔する — leaning toward sorrowful rumination rather than the broader 'regret' of 後悔. The progressive ~ている here marks an ongoing emotional state: she's still in the grip of that regret, not just a momentary feeling.