let str = "The Worlds most reliable Programming Q&A Site worlds";
const the_word = "Worlds";
const re = new RegExp(the_word, "gi");
str = str.replace(re, function UpperCase(s) { return s.toUpperCase(); });
console.log(str);
/*
run:
"The WORLDS most reliable Programming Q&A Site WORLDS"
*/