You can check if a string contains a specific word:
if (yourVariable.indexOf("phone") >= 0){
alert('you may not use the word phone');
}
, .
var words = ['phone', 'home', 'address', 'bobba'];
for (i = 0; i < words.length; i++) {
if (yourVariable.indexOf(words[i]) >= 0){
alert('you may not use the word ' + words[i]);
}
}
, , , , :
yourVariable.replace(words[i], 'xxx');
, : https://jsfiddle.net/jx8wd1br/1/