; j++) { var regex_array = regex.split(";"); for(var k = 0; k < regex_array.length; k++) { if (elements[j].innerHTML.match(new RegExp(regex_array[k], "i"))) { var replaced_txt = elements[j].innerHTML.replace(new RegExp(regex_array[k], "i"), ''); elements[j].innerHTML = replaced_txt; } } } } }