Example Resulting value of x
var str = "Hello WORLD Helloooo"
var x = str.replace(/o{2,}/gi,"*");
Hello WORLD Hell*