She regretted having behaved rudely toward him.

Literal

She [topic-は] him [to-に] rude [adj-な] attitude [object-を] took thing [object-を] regretted.

態度をとる ('take/adopt an attitude') is a common collocation for adopting a stance or behavior — it's how Japanese says 'behave (in a certain way) toward someone.' The full clause 失礼な態度をとった ('took a rude attitude') is then nominalized by ことを and made the object of 後悔する ('regret'). A nice example of nominalization for embedding past actions as objects.