It repenteth me that I have set up Saul to be king: for he is turned back from following me, and hath not performed my commandments. And it grieved Samuel; and he cried unto the Lord all night.
1 Samuel 15:11
The Lord regretted that he had made human beings on the earth, and his heart was deeply troubled.
Genesis 6:6
The Hebrew word which is used in these passages which is Nacham doesn’t necessarily mean repent as in how humans repent it can also mean grieved or to console ones self:
Strong's Hebrew: 5162. נָחַם (nacham) -- to be sorry, console oneself
The NIV and other translations actually translate Nacham as grieve or grieved which is sometimes more accurate in passages such as these:
"‘I am
grieved that I have made Saul king,
because he has turned away from me and has not carried out my instructions.’ Samuel was troubled, and he cried out to the LORD all that night… He who is the Glory of Israel
DOES NOT LIE OR CHANGE HIS MIND; for he is not a man, that he should change his mind… Until the day Samuel died, he did not go to see Saul again, though Samuel mourned for him. And the LORD was
grieved that he had made Saul king over Israel." 1 Samuel 15:11-35 NIV
"The LORD was
grieved that he had made man on the earth,
and his heart was filled with pain." Genesis 6:6 NIV
That said it makes perfect sense that God grieves his creation especially Israel whenever they turn away from him in sin, this does not mean that God is having second thoughts or is changing his mind, John Gill in his commentary also explains what is meant when God repents or grieves:
I will repent of the evil that one thought to do unto them; as they change their course of life, God will change the dispensations of his providence towards them, and not bring upon them the evil of punishment he threatened them with; in which sense repentance CAN ONLY BE UNDERSTOOD OF GOD, he doing that which is similar to what men do when they repent of anything; they stop their proceedings, and change their outward conduct; so God proceeds not to do what he threatened to do, and changes his outward behaviour to men; he wills a change, and makes one in his methods of acting, BUT NEVER CHANGES HIS WILL.
Jeremiah 18 Gill's Exposition
God acts in accordance to the free will of humanity, God is grieved and repents (Nacham) when humanity expresses sin and acts in accordance to that sin with judgement and refrains only when they repent. This does not mean God changes his mind, but rather he is consistent and immutable in regards to his will.
By the way you can find similar verses to these in your own Quran:
Then Adam received commandments from his Lord, and his Lord
repented (fataba) towards him; for He is
Oft-Repenting (huwa al-tawwabu), Most Merciful. S. 2:37
And remember Moses said to his people: ‘O my people! ye have indeed wronged yourselves by your worship of the calf;
so repent (fataboo) to your Maker, and slay yourselves (the wrong-doers); that will be better for you in the sight of your Maker.’
Then He repented (fataba) towards you: for He is
Oft-Repenting (huwa al-tawwabu), Most Merciful. S. 2:54
Our Lord! And make us submissive unto you and of our seed a nation submissive unto you, and show us our ways of worship,
and repent (watub) toward us. Lo! You, only You,
are the Oft-Repenting (anta al-tawwabu), the Merciful. S. 2:128
Except those who
repent (taboo) and make amends and openly declare:
To them I repent (atoobu); for I am Oft-Repenting (wa ana al-tawwabu), Most Merciful. S. 2:160
Do they not know that Allah accepts
repentance (al-tawbata) from His servants, and takes alms; and that Allah is He who is
Oft-Repenting (huwa al-tawwabu) and merciful. S. 9:104
And to the three who were left behind, until the earth became strait to them notwithstanding its spaciousness and their souls were also straightened to them; and they knew it for certain that there was no refuge from Allah but in Him;
then He repented (taba) to them that they might repent (liyatooboo); surely Allah is the Oft-repenting (huwa al-tawwabu), the Merciful. S. 9:118