From 4704ee4297fc4f5510421dea08965a83efa22397 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 31 Mar 2015 13:46:57 +0100 Subject: Add some more SA and perl compat for regexps. --- src/libutil/regexp.c | 6 ++++++ test/lua/unit/regxep.lua | 1 + 2 files changed, 7 insertions(+) diff --git a/src/libutil/regexp.c b/src/libutil/regexp.c index a83660e8e..61ddc908a 100644 --- a/src/libutil/regexp.c +++ b/src/libutil/regexp.c @@ -135,6 +135,12 @@ rspamd_regexp_new (const gchar *pattern, const gchar *flags, else if (*start == 'm') { start ++; sep = *start; + + /* Paired braces */ + if (sep == '{') { + sep = '}'; + } + rspamd_flags |= RSPAMD_REGEXP_FLAG_FULL_MATCH; } if (sep == '\0' || g_ascii_isalnum (sep)) { diff --git a/test/lua/unit/regxep.lua b/test/lua/unit/regxep.lua index e33d20d43..04db54aa9 100644 --- a/test/lua/unit/regxep.lua +++ b/test/lua/unit/regxep.lua @@ -13,6 +13,7 @@ context("Regexp unit tests", function() {'/^test$/m', '123test', false}, {'m,test,', 'test', true}, {'m,test,', 'test123', false}, + {'m{https?://[^/?\\s]+?:\\d+(?