If God is omniscient how can he regret?
The ability to know things would not exclude the possibility of having an emotional reaction.
A parent may know that his child is going to fall down, however, that parent still encourages the child to learn to walk. The child that bangs his head on the coffee table can cause regret in the heart of the parent.
The regret of God is not the surprise event he didn't anticipate. It is the sorrow in the heart of a parent for a child that makes wrong decisions.
We have an example of God repenting (changing his mind) in reaction to an emotional perception.
1 Chronicles 21:15 And God sent an angel unto Jerusalem to destroy
it: and as he was destroying, the LORD beheld, and he repented him of
the evil, and said to the angel that destroyed, It is enough, stay now
thine hand. And the angel of the LORD stood by the threshingfloor of
Ornan the Jebusite.
Even though the three days of pestilence had not been fulfilled, the reaction to the death of 70,000 men was sufficient to cause God to stop the punishment.