+ /* Is it tag pattern? */
+ if (0 == strncmpic("TAG:", url->spec, 4))
+ {
+ if (NULL == (url->tag_regex = zalloc(sizeof(*url->tag_regex))))
+ {
+ freez(url->spec);
+ return JB_ERR_MEMORY;
+ }
+
+ /* buf + 4 to skip "TAG:" */
+ errcode = regcomp(url->tag_regex, buf + 4, (REG_EXTENDED|REG_NOSUB|REG_ICASE));
+ if (errcode)
+ {
+ errlen = regerror(errcode, url->preg, rebuf, sizeof(rebuf));
+ if (errlen > (sizeof(rebuf) - 1))
+ {
+ errlen = sizeof(rebuf) - 1;
+ }
+ rebuf[errlen] = '\0';
+
+ log_error(LOG_LEVEL_ERROR, "error compiling %s: %s", url->spec, rebuf);
+
+ freez(url->spec);
+ regfree(url->tag_regex);
+ freez(url->tag_regex);
+
+ return JB_ERR_PARSE;
+ }
+ return JB_ERR_OK;
+ }
+
+ /* Only reached for URL patterns */