Dark Souls,
	
	| Сообщение от Aetae | 
	| Строки попадающие в new RegExp должны быть экранированы. | 
	
 c экранированием 
String.prototype.str_replace_all = function(arRegexp, str) {
function escapeRegExp(string){
  return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
var expr = new RegExp(arRegexp.map(escapeRegExp).join("|"), "gi");
return this.replace(expr, str)
}
alert("one two three for five".str_replace_all(["two", "for"], "|"));