mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Cosmetics: Fix coding style
This commit is contained in:
@@ -40,19 +40,22 @@ Regex::Regex(const std::string& pattern_)
|
||||
pattern.assign(".*");
|
||||
}
|
||||
|
||||
m_pc = pcre_compile(pattern.c_str(), PCRE_DOTALL|PCRE_MULTILINE, &errptr, &erroffset, NULL);
|
||||
m_pc = pcre_compile(pattern.c_str(), PCRE_DOTALL|PCRE_MULTILINE,
|
||||
&errptr, &erroffset, NULL);
|
||||
m_pce = pcre_study(m_pc, PCRE_STUDY_JIT_COMPILE, &errptr);
|
||||
}
|
||||
|
||||
int regex_search(const std::string& s, SMatch *match,
|
||||
const Regex& regex) {
|
||||
int ovector[OVECCOUNT];
|
||||
return pcre_exec(regex.m_pc, regex.m_pce, s.c_str(), s.size(), 0, 0, ovector, OVECCOUNT) > 0;
|
||||
return pcre_exec(regex.m_pc, regex.m_pce, s.c_str(),
|
||||
s.size(), 0, 0, ovector, OVECCOUNT) > 0;
|
||||
}
|
||||
|
||||
int regex_search(const std::string& s, const Regex& regex) {
|
||||
int ovector[OVECCOUNT];
|
||||
return pcre_exec(regex.m_pc, regex.m_pce, s.c_str(), s.size(), 0, 0, ovector, OVECCOUNT) > 0;
|
||||
return pcre_exec(regex.m_pc, regex.m_pce, s.c_str(),
|
||||
s.size(), 0, 0, ovector, OVECCOUNT) > 0;
|
||||
}
|
||||
|
||||
} // namespace Utils
|
||||
|
@@ -13,10 +13,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <pcre.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <pcre.h>
|
||||
|
||||
#ifndef SRC_UTILS_REGEX_H_
|
||||
#define SRC_UTILS_REGEX_H_
|
||||
|
Reference in New Issue
Block a user