diff options
author | Adam <Adam@anope.org> | 2014-04-02 13:06:48 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2014-04-02 13:08:14 -0400 |
commit | 52bc8e4bc799d38e92d38d497a2bd055950841bb (patch) | |
tree | b80ea985f1adffa43ca046c014e3b81f9404db8d /src/config.cpp | |
parent | ee133c03f206a7fab78a700b183fbc8684b9d6bf (diff) |
Remove regex mods, use std::regex instead
Diffstat (limited to 'src/config.cpp')
-rw-r--r-- | src/config.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/config.cpp b/src/config.cpp index 0275cb7f8..6473cf830 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -115,6 +115,7 @@ Conf::Conf() : Block("") { ReadTimeout = 0; UsePrivmsg = DefPrivmsg = false; + regex_flags = 0; this->LoadConf(ServicesConf); @@ -526,6 +527,25 @@ Conf::Conf() : Block("") if (!options->Get<unsigned>("seed")) Log() << "Configuration option options:seed should be set. It's for YOUR safety! Remember that!"; + /* check regexengine */ + const Anope::string ®ex_engine = options->Get<Anope::string>("regexengine"); + if (regex_engine == "ecmascript") + regex_flags = std::regex::ECMAScript; + else if (regex_engine == "basic") + regex_flags = std::regex::basic; + else if (regex_engine == "extended") + regex_flags = std::regex::extended; + else if (regex_engine == "awk") + regex_flags = std::regex::awk; + else if (regex_engine == "grep") + regex_flags = std::regex::grep; + else if (regex_engine == "egrep") + regex_flags = std::regex::egrep; + /* always enable icase and optimize */ + if (regex_flags) + regex_flags |= std::regex::icase | std::regex::optimize; + + /* apply changes from an older config? */ if (Config) { /* Apply module chnages */ |