const escapeRegExp = (string) => string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string const replaceAll = (str, find, replace) => (`${str}`).replace(new RegExp(escapeRegExp(find), 'g'), replace);
178200cookie-checkJavascript: Escape regex / String replace all