Pattern (Collection<String> stringSet) { final StringBuilder sb = new StringBuilder(); for (String s : stringSet) { if (!InjectorUtils.isRegexp(s)) continue; if (sb.length() > 0) sb.append('|'); sb.append("(?:").append(s).append(")"); } return sb.length() == 0 ? null : Pattern.compile(sb.toString()); }