diff options
Diffstat (limited to 'src/stringutils.cpp')
-rw-r--r-- | src/stringutils.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/stringutils.cpp b/src/stringutils.cpp index 1f5ff47..e903941 100644 --- a/src/stringutils.cpp +++ b/src/stringutils.cpp @@ -22,14 +22,12 @@ #include "stringutils.h" -#include <string> #include <algorithm> #include <cctype> #include <cstdarg> #include <cstdio> #include <ctime> #include <list> -#include <regex> #include <sys/stat.h> @@ -708,12 +706,21 @@ void secureChatCommand(std::string &str) str = "_" + str; } -bool isMatch(const std::string &str, const std::string &exp) +bool isMatch(const std::string &str, + const std::string &exp) { std::regex regExp(exp); return std::regex_match(str, regExp); } +bool isMatch(const std::string &str, + const std::string &exp, + std::smatch &m) +{ + std::regex regExp(exp); + return std::regex_match(str, m, regExp); +} + bool fileExists(const std::string &name) { struct stat statbuf; |