“‘I welcome the opportunity to uphold our finest Wizarding traditions and values—’ Like committing murder and cutting off people’s ears, I suppose! Snape, headmaster! Snape in Dumbledore’s study—Merlin’s pants!”
-- Hermione Granger (DH12)
“How in the name of Merlin’s pants have you managed to get your hands on those Horcrux books?” (DH6)
Hermione says this when she realises that the portrait of Phineas Nigellus Black at Number Twelve Grimmauld Place might be reporting their conversations back to Headmaster Snape at Hogwarts, and she runs out of the room. Ron then turns to Harry:
“‘Merlin’s pants?'” repeated Ron, looking amused. “She must be upset.” (DH12)
Ron’s reply when she returns to the room is similar but more explicit:
“And what in the name of Merlin’s most baggy Y-fronts was that about?” (DH12)
For Americans: in British English, "pants" means "underpants", not "trousers".