Just to add to my previous reply, the documentation for the regexreplace says:
RegexReplace(String, Regex, Flags, Replace)
In String substitute matches for the regular expression Regex (with Flags) with the string Replace. The replacement string can contain the following special characters: $$ (inserts a $), $& (inserts the matched substring), $` (inserts the portion of the string that precedes the matched substring), or $' (inserts the portion of the string that follows the matched substring).
...but it didn't explain what exactly is regex and what is the flag. I suppose that this is coming from another langage so I'll google it...in your example korbaach you use "m" as a flag and I can reproduce it but I like to know what every thing in my code means.