Using libpcre instead of c++11 regex

This commit is contained in:
Felipe Zimmerle
2015-08-02 19:55:16 -03:00
parent 2f4d4691c9
commit 17f88f5821
10 changed files with 233 additions and 12 deletions

View File

@@ -17,9 +17,9 @@
#include <iostream>
#include <string>
#include <regex>
#include "modsecurity/debug_log.h"
#include "utils/regex.h"
namespace modsecurity_test {
@@ -34,10 +34,11 @@ bool CustomDebugLog::write_log(int level, const std::string& message) {
bool CustomDebugLog::contains(const std::string& pattern) {
std::regex re(pattern);
std::smatch match;
ModSecurity::Utils::Regex re(pattern);
ModSecurity::Utils::SMatch match;
std::string s = m_log.str();
return (std::regex_search(s, match, re) && match.size() >= 1);
return (ModSecurity::Utils::regex_search(s, &match, re)
&& match.size() >= 1);
}
std::string CustomDebugLog::log_messages() {