ObjectCompare { public static final boolean isInListByRegEx(String target, String... regExs) { if (StringUtils.isBlank(target)) return false; if (regExs != null && regExs.length > 0) { for (String regEx : regExs) { if (StringUtils.isBlank(regEx)) continue; if (Pattern.compile(regEx).matcher(target).find()) return true; } } return false; }  static final boolean isInList(Object target, Object... source); static final boolean isInList(Object target, String... source); static final boolean isInListByRegEx(String target, String... regExs); static final boolean isInListByRegEx(String target, Set<String> regExs); static final boolean isInEndWiths(String target, String... source);  }
@Test public void test0() { LOG.debug("Test reg empty: " + ObjectCompare.isInListByRegEx("Test", "")); }