diff options
author | Attila Molnar <attilamolnar@hush.com> | 2013-08-27 05:28:15 -0700 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2013-08-27 05:28:15 -0700 |
commit | 620e818578a5e0dbebd07fb27a571d5392c66c24 (patch) | |
tree | 6d20eef5fd9b98fecd93df2caf197ad08c168562 /src/modules/extra/m_regex_stdlib.cpp | |
parent | d9d9cbe025f94523265daa72de7596467d71f5c8 (diff) | |
parent | eaf658de3d1ef984c9a0b4273a9cfbd3029f8b5b (diff) |
Merge pull request #619 from SaberUK/master+regex-dedupe
Various regex module improvements.
Diffstat (limited to 'src/modules/extra/m_regex_stdlib.cpp')
-rw-r--r-- | src/modules/extra/m_regex_stdlib.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/modules/extra/m_regex_stdlib.cpp b/src/modules/extra/m_regex_stdlib.cpp index d69f739ec..5ec358d58 100644 --- a/src/modules/extra/m_regex_stdlib.cpp +++ b/src/modules/extra/m_regex_stdlib.cpp @@ -22,15 +22,6 @@ /* $CompileFlags: -std=c++11 */ -class StdRegexException : public ModuleException -{ - public: - StdRegexException(const std::string& rx, const std::string& error) - : ModuleException(std::string("Error in regex ") + rx + ": " + error) - { - } -}; - class StdRegex : public Regex { std::regex regexcl; @@ -43,11 +34,11 @@ class StdRegex : public Regex } catch(std::regex_error rxerr) { - throw StdRegexException(rx, rxerr.what()); + throw RegexException(rx, rxerr.what()); } } - bool Matches(const std::string& text) + bool Matches(const std::string& text) CXX11_OVERRIDE { return std::regex_search(text, regexcl); } @@ -58,7 +49,7 @@ class StdRegexFactory : public RegexFactory public: std::regex::flag_type regextype; StdRegexFactory(Module* m) : RegexFactory(m, "regex/stdregex") {} - Regex* Create(const std::string& expr) + Regex* Create(const std::string& expr) CXX11_OVERRIDE { return new StdRegex(expr, regextype); } |