String[] patterns = listOfPatterns.split(SEPARATOR);
for(String p: patterns) {
int equalsPos = p.indexOf('=');
if(equalsPos < 0 || equalsPos > (p.length() -2)) {
throw new CheckedPatternSyntaxException(
"pattern must be of form targ=pattern", p, -1);
}
String targ = p.substring(0, equalsPos);
if(!targ.startsWith("tags.") && !ArrayUtils.contains(SEARCH_TARGS, targ)) {
throw new CheckedPatternSyntaxException(
"pattern doesn't start with recognized search target", p, -1);
}
String regex = p.substring(equalsPos+1);
if (!RegexUtil.isRegex(regex)) {
throw new CheckedPatternSyntaxException(RegexUtil.regexException(regex));
}
Pattern pat = Pattern.compile(regex, Pattern.DOTALL);
compiledPatterns.add(new SearchRule(pat, targ));
}