3

Заменить все вхождения подстроки в строке, без учёта регистра

var str="Welcome to Microsoft! ";
str = str + "We are proud to announce that Microsoft has ";
str = str + "one of the largest Web Developers sites in the world.";

document.write(str.replace(/microsoft/gi, "W3Schools"));
Welcome to W3Schools! We are proud to announce that W3Schools
has one of the largest Web Developers sites in the world.
-----------