Prepare a list of forbidden words, go over the words, convert words into regex, eg "smurf" -> " s *m *u *r *f * "
String regex = " " + word.replaceAll("(.)", "$1 *") + " ";
and try to find it in the text
boolean found = Pattern.compile(regex).matcher(text).find();