function filtion(){
var a= "fuck你他妈的有病";
var arr = ["fuck", "tmd", "他妈的"];
for (var i = 0; i < arr.length; i++) {
var r = new RegExp(arr[i],"ig");
a = a.replace(r, "*");
}
document.write(a);
}
filtion();