Of course I understand the meaning of regret. Also, if God really is omniscient, then couldn't he have foreseen what was going to happen beforehand, and wouldn't he have stopped it before said regret could take place?
Not necessarily.
We must understand the reason for God's "regret".
If humans had not sinned in Eden, sentencing all their offspring to the genetic defects that accompany sin, (Rom 5:12) then the actions of wicked men in Noah's day would never have happened. There would have been nothing for God to feel regret about....would there?
If Adam and his wife had rejected satan's temptation, then the rebel who caused the problem in the first place would have been taken out of existence and we would have been none the wiser. But because the first rebel was not human, and he influenced the human race and made them into rebels too, God allowed the one they obeyed to rule over them. It was an object lesson for all of Adam's children and all of the other angels observing the scenario. They would prove to themselves that they cannot direct themselves without the guidance and wisdom of their Creator.
We have never experienced God's rulership without interference from the devil and the shadow of sin hanging over us spoiling everything we do. Whenever men gain power over other humans, corruption follows. Misery comes through humans abusing their free will. We are designed to be ruled by God, not corrupt men influenced by satan. (Jer 10:23; 1John 5:19)
Imagine the life God had planned for us at the beginning, now taken away and misery and death taking its place. When the lesson is over, (soon now) God will bring his rulership back to the earth without rebels messing everything up. They will all be gone. (Psalm 37:8-11, 29; Prov 2:21, 22)