Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:4:73

But if bounty comes to you from Allah, he will surely say, as if there had never been between you and him any affection. "Oh, I wish I had been with them so I could have attained a great attainment."  

But if (wa-la-in, the lām is for oaths) a bounty from God befalls you, such as a conquest or booty, he will surely cry, in regret, as if (ka’an is softened, its subject having been omitted, in other words ˹it should be˺ ka’annahu) there had never been (read lam yakun, or lam takun) any affection, any acquaintance or friendship, between you and him: this ˹statement˺ refers back to the words ˹in the previous verse˺ ‘God has been gracious to me’, and comes as a parenthesis between the statement ‘that he will cry’ and the very words he cries, which are: ‘Oh (yā, is for exclamation), would that I had been with them, so that I might have won a great triumph!’, that is, ˹that˺ I might have taken a good share of the booty.
القرآن:٤:٧٣

وَلَئِنْ أَصَابَكُمْ فَضْلٌ مِنَ اللَّهِ لَيَقُولَنَّ كَأَنْ لَمْ تَكُنْ بَيْنَكُمْ وَبَيْنَهُ مَوَدَّةٌ يَا لَيْتَنِي كُنْتُ مَعَهُمْ فَأَفُوزَ فَوْزًا عَظِيمًا  

{ولئن} لام قسم {أصابكم فضل من الله} كفتح وغنيمة {لَيَقُولَنَّ} نادما {كأن} مخففة واسمها محذوف أي كأنه {لم يكن} بالياء والتاء {بينكم وبينه مودة} معرفة وصداقة وهذا راجع إلى قوله (قد أنعم الله علىَّ)، اعترض به بين القول ومقوله وهو {يا} للتنبيه {ليتني كنت معهم فأفوزَ فوزا عظيما} آخذ حظا وافرا من الغنيمة قال تعالى.