summaryrefslogtreecommitdiff
path: root/src/xline.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/xline.cpp')
-rw-r--r--src/xline.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/xline.cpp b/src/xline.cpp
index ea74ba8c7..8c8f6034c 100644
--- a/src/xline.cpp
+++ b/src/xline.cpp
@@ -15,7 +15,6 @@
#include "xline.h"
#include "users.h"
#include "sockets.h"
-#include "regexpr.h"
#include "config.h"
#include "commands.h"
#include "servers.h"
@@ -26,21 +25,17 @@ Serialize::Checker<std::multimap<Anope::string, XLine *, ci::less> > XLineManage
void XLine::InitRegex()
{
- if (this->mask.length() >= 2 && this->mask[0] == '/' && this->mask[this->mask.length() - 1] == '/' && !Config->GetBlock("options")->Get<const Anope::string>("regexengine").empty())
+ if (this->mask.length() >= 2 && this->mask[0] == '/' && this->mask[this->mask.length() - 1] == '/' && Config->regex_flags)
{
Anope::string stripped_mask = this->mask.substr(1, this->mask.length() - 2);
- ServiceReference<RegexProvider> provider("Regex", Config->GetBlock("options")->Get<const Anope::string>("regexengine"));
- if (provider)
+ try
{
- try
- {
- this->regex = provider->Compile(stripped_mask);
- }
- catch (const RegexException &ex)
- {
- Log(LOG_DEBUG) << ex.GetReason();
- }
+ this->regex = new std::regex(stripped_mask.str(), Config->regex_flags);
+ }
+ catch (const std::regex_error &ex)
+ {
+ Log(LOG_DEBUG) << ex.what();
}
}
}