The Messenger of Allah ﷺ said, "There is no one who dies except that he feels regret."They asked, "What is his regret, Messenger of Allah?"He replied, "If he was a doer of good, he regrets not having done more. If he was a wrongdoer, he regrets not having abandoned his wrongdoing."
حدثنا سويد بن نصر أخبرنا ابن المبارك أخبرنا يحيى بن عبيد الله قال سمعت أبي يقول سمعت
قال رسول الله ﷺ ما من أحد يموت إلا ندم قالوا وما ندامته يا رسول الله قال إن كان محسنا ندم أن لا يكون ازداد وإن كان مسيئا ندم أن لا يكون نزع
No references are available.
[Its chain of transmission is very daif] It was also related by Ibn Adi in al-Kamil: 2660/7, from the hadith of Ibn Mubarak, with the same wording. Yahya bin Ubaydullah is discarded as a narrator (matruk). However, the substance of the hadith has corroborating narrations in Bukhari, no. 5673, 7235, and Nasai: 2/4, no. 1819, and elsewhere.