Surah Al-A'raf 7:129
قَالُوٓا۟ أُوذِينَا مِن قَبْلِ أَن تَأْتِيَنَا وَمِنۢ بَعْدِ مَا جِئْتَنَا ۚ قَالَ عَسَىٰ رَبُّكُمْ أَن يُهْلِكَ عَدُوَّكُمْ وَيَسْتَخْلِفَكُمْ فِى ٱلْأَرْضِ فَيَنظُرَ كَيْفَ تَعْمَلُونَ
They said, "We have been harmed before you came to us and after you have come to us." He said, "Perhaps your Lord will destroy your enemy and grant you succession in the land and see how you will do."
Translation: Saheeh International
Tafsir
They said ‘We suffered harm before you came to us and since you have come to us.’ He said ‘Perhaps your Lord will destroy your enemy and make you successors in the land that He may observe how you shall act’ in it.
Excerpt from Tafsir al-Jalalayn, commentary on 7:129, via Quran.com. The reader has the full commentary and 9 more tafsirs.