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:25:27

And the Day the wrongdoer will bite on his hands ˹in regret˺ he will say, "Oh, I wish I had taken with the Messenger a way.  

And ˹it will be˺ a day when the wrongdoer, the idolater, ‘Uqba b. Abī Mu‘ayt — who had uttered the two-part profession ˹‘there is no god but God, Muhammad (s) is His Messenger’˺ but retracted it in order to please Ubayy b. Khalaf — will bite his hands, in regret and anguish on the Day of Resurrection, saying, ‘O (yā is for drawing attention) would that I had followed a way with the Messenger!, Muhammad (s), a route to guidance.
القرآن:٢٥:٢٧

وَيَوْمَ يَعَضُّ الظَّالِمُ عَلَىٰ يَدَيْهِ يَقُولُ يَا لَيْتَنِي اتَّخَذْتُ مَعَ الرَّسُولِ سَبِيلًا  

{ويوم يعضُّ الظالم} المشرك: عقبة بن أبي معيط كان نطق بالشهادتين ثم رجع إرضاءً لأبيّ بن خلف {على يديه} ندما وتحسرا في يوم القيامة {يقول يا} للتنبيه {ليتني اتخذت مع الرسول} محمد {سبيلا} طريقا إلى الهدى.