var cad = "Juan es hermano de Juan Luis"; var aux; aux = cad.replace(/Juan/gi, "Jose"); document.write(cad + "
"); document.write(aux + "
");