@Test public void testContainsForbiddenWord() { String input = "12职称英语买答案32"; Assert.assertTrue(ForbiddenWordUtils.containsForbiddenWord(input)); }
public static boolean containsForbiddenWord(String input) { for (int i = 0, l = forbiddenWords.size(); i < l; i++) { Pattern forbiddenWordPattern = forbiddenWords.get(i); if (forbiddenWordPattern.matcher(input).find()) { return true; } } return false; }
ForbiddenWordUtils { public static boolean containsForbiddenWord(String input) { for (int i = 0, l = forbiddenWords.size(); i < l; i++) { Pattern forbiddenWordPattern = forbiddenWords.get(i); if (forbiddenWordPattern.matcher(input).find()) { return true; } } return false; } }
ForbiddenWordUtils { public static boolean containsForbiddenWord(String input) { for (int i = 0, l = forbiddenWords.size(); i < l; i++) { Pattern forbiddenWordPattern = forbiddenWords.get(i); if (forbiddenWordPattern.matcher(input).find()) { return true; } } return false; }  }
ForbiddenWordUtils { public static boolean containsForbiddenWord(String input) { for (int i = 0, l = forbiddenWords.size(); i < l; i++) { Pattern forbiddenWordPattern = forbiddenWords.get(i); if (forbiddenWordPattern.matcher(input).find()) { return true; } } return false; }  static void setForbiddenWordFetchURL(String forbiddenWordFetchURL); static void setReloadInterval(int reloadInterval); static String replace(String input); static String replace(String input, String mask); static boolean containsForbiddenWord(String input); static void initRemoteFetch(); }
ForbiddenWordUtils { public static boolean containsForbiddenWord(String input) { for (int i = 0, l = forbiddenWords.size(); i < l; i++) { Pattern forbiddenWordPattern = forbiddenWords.get(i); if (forbiddenWordPattern.matcher(input).find()) { return true; } } return false; }  static void setForbiddenWordFetchURL(String forbiddenWordFetchURL); static void setReloadInterval(int reloadInterval); static String replace(String input); static String replace(String input, String mask); static boolean containsForbiddenWord(String input); static void initRemoteFetch();  }