how…!; what…!
Expresses a strong emotional reaction, often surprise or admiration, about the degree or extent of something.
ことか is used to emphasize how much something is the case, usually after a subordinate clause that sets up the context. It often follows expressions like どんなに, どれほど, or なんと, but can be used alone. The speaker expresses a feeling of intensity, such as surprise, relief, or regret, about the fact stated before it.
This pattern is more common in written language, especially in narratives or reflective statements, but can also be spoken for dramatic effect. It is not used in casual everyday questions; rather, it is a rhetorical exclamation. The verb before ことか is typically in the past tense, as the emotion is about a realized fact or an event that has occurred.