Here you can find the source of replaceAll(find, replace)
// taken from http://stackoverflow.com/questions/1144783/replacing-all-occurrences-of-a-string-in-javascript on 20150330 at 11:12 EST // extended to be a prototype String.prototype.replaceAll = function (find, replace) { return this.replace(new RegExp(find, 'g'), replace); };
String.prototype.replaceAll = function(f,r) { return this.split(f).join(r); };
String.prototype.replaceAll = function (find, replace) { var str = this; return str.replace(new RegExp(find, 'g'), replace); };
String.prototype.replaceAll = function(find, replace) { return this.replace(new RegExp(find, 'g'), replace); };
String.prototype.replaceAll = function (find, replace) { var str = this; return str.replace(new RegExp(find.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), 'g'), replace); };
function escapeRegExp(string) { return string.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); String.prototype.replaceAll = function (find, replace) { return this.replace(new RegExp(escapeRegExp(find), 'g'), replace);
String.prototype.replaceAll = function(find, replace){ find = find.escapeRegExp(); return this.replaceAllRegExp(find, replace); };
String.prototype.replaceAll = function (find, replace) { return this.replace(new RegExp(find, 'g'), replace); }; String.prototype.sanitize = function () { var s = this.replace(/\W+/g, ""); return s; };
String.prototype.replaceAll = function(find, replace) { var str = this; return str.replace(new RegExp(find, 'g'), replace); };
String.prototype.replaceAll = function (find, replace) { var str = this; return str.replace(new RegExp(find.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), 'g'), replace); };