summaryrefslogtreecommitdiffstats
path: root/src/libutil
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/regexp.c10
-rw-r--r--src/libutil/regexp.h7
2 files changed, 16 insertions, 1 deletions
diff --git a/src/libutil/regexp.c b/src/libutil/regexp.c
index 8d023569c..6c2046dd4 100644
--- a/src/libutil/regexp.c
+++ b/src/libutil/regexp.c
@@ -155,7 +155,7 @@ rspamd_regexp_new (const gchar *pattern, const gchar *flags,
end = pattern + strlen (pattern);
}
- regexp_flags |= PCRE_UTF8;
+ regexp_flags |= PCRE_UTF8 | PCRE_NO_AUTO_CAPTURE;
if (flags != NULL) {
flags_str = flags;
@@ -356,6 +356,14 @@ rspamd_regexp_search (rspamd_regexp_t *re, const gchar *text, gsize len,
return FALSE;
}
+const char*
+rspamd_regexp_get_pattern (rspamd_regexp_t *re)
+{
+ g_assert (re != NULL);
+
+ return re->pattern;
+}
+
gboolean
rspamd_regexp_match (rspamd_regexp_t *re, const gchar *text, gsize len,
gboolean raw)
diff --git a/src/libutil/regexp.h b/src/libutil/regexp.h
index fdbe44404..6e8aa7295 100644
--- a/src/libutil/regexp.h
+++ b/src/libutil/regexp.h
@@ -76,6 +76,13 @@ rspamd_regexp_t* rspamd_regexp_ref (rspamd_regexp_t *re);
void rspamd_regexp_unref (rspamd_regexp_t *re);
/**
+ * Get pattern for the specified regexp object
+ * @param re
+ * @return
+ */
+const char* rspamd_regexp_get_pattern (rspamd_regexp_t *re);
+
+/**
* Create new regexp cache
* @return
*/