let str = "The Worlds most reliable Programming Q&A worlds";
const the_word = "Worlds|reliable";
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 WORLDS"
*/