function decode (a) {
a.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&");
}
str.replace(/replace\((.+?)\)/g, decode("$1"));
str.replace(/replace\((.+?)\)/g, "$1".replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&"));