{
tagPatternWithBookmark = Pattern.compile(tagRegexWithBookmark);
}
catch (PatternSyntaxException e)
{
throw new RollerException("Invalid regular expression for topic tags with bookmark '" +
tagRegexWithBookmark + "': " + e.getMessage());
}
int groupCount = tagPatternWithBookmark.matcher("").groupCount();
if (groupCount != 2)
{
throw new RollerException("Regular expression for topic tags with bookmark '" + tagRegexWithBookmark +
"' contains wrong number of capture groups. Must have exactly 2. Contains " + groupCount);
}
try
{
tagPatternWithoutBookmark = Pattern.compile(tagRegexWithoutBookmark);
}
catch (PatternSyntaxException e)
{
throw new RollerException("Invalid regular expression for topic tags without bookmark '" +
tagRegexWithoutBookmark + "': " + e.getMessage());
}
groupCount = tagPatternWithoutBookmark.matcher("").groupCount();
if (groupCount != 1)
{
throw new RollerException("Regular expression for topic tags without bookmark '" + tagRegexWithoutBookmark +
"' contains wrong number of capture groups. Must have exactly 1. Contains " + groupCount);
}
// Create link format from format string
setLinkFormat(new MessageFormat(linkFormatString));