Sayyiduna Abu Hurayrah (may Allah be pleased with him) says that the Messenger of Allah (peace and blessings be upon him) said: "The burden of what two people who revile each other say falls on the one who started it, as long as the wronged one does not transgress."
This is also narrated in the hadith of Sayyiduna Anas bin Malik (may Allah be pleased with him), and it contains evidence that retaliating is permissible without transgression and without displaying obscenity. The hadith of Sayyidah Aishah (may Allah be pleased with her) about the story of Sayyidah Zaynab bint Jahsh (may Allah be pleased with her) is evidence that retaliating is permitted, where she said: "Zaynab bint Jahsh had not yet left when I realised that the Messenger of Allah (peace and blessings be upon him) did not dislike my retaliating." But pardoning and leaving retaliation is better.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الشهادات / 21089