Support PCRE2

This commit is contained in:
Martin Vierula
2022-04-13 09:37:54 -07:00
parent 5519f6cfae
commit f84614fe06
9 changed files with 380 additions and 18 deletions

View File

@@ -12,8 +12,12 @@
* directly using the email address security@modsecurity.org.
*
*/
#if WITH_PCRE2
#define PCRE2_CODE_UNIT_WIDTH 8
#include <pcre2.h>
#else
#include <pcre.h>
#endif
#include <iostream>
#include <fstream>
@@ -76,8 +80,13 @@ class Regex {
const std::string pattern;
private:
#if WITH_PCRE2
pcre2_code *m_pc;
pcre2_match_data *m_match_data;
#else
pcre *m_pc = NULL;
pcre_extra *m_pce = NULL;
#endif
};