44#define FORCE_OLD_REGEX 1
52#define HAVE_WORKING_REGEX 0
56#if __cplusplus >= 201103L && \
57 (!defined(__GLIBCXX__) || (__cplusplus >= 201402L) || \
58 (defined(_GLIBCXX_REGEX_DFS_QUANTIFIERS_LIMIT) || \
59 defined(_GLIBCXX_REGEX_STATE_LIMIT) || \
60 (defined(_GLIBCXX_RELEASE) && \
61 _GLIBCXX_RELEASE > 4)))
63#define HAVE_WORKING_REGEX 1
68#define HAVE_WORKING_REGEX 0
93 std::string d_pattern;
95 void init(
const char *s) { d_exp = std::regex(s); }
96 void init(
const std::string &s) { d_exp = std::regex(s); }
104 std::unique_ptr<regex_t> d_preg;
105 std::string d_pattern;
107 void init(
const char *t);
108 void init(
const std::string &s) { init(s.c_str()); d_pattern = s; }
115 explicit BESRegex(
const std::string &s) { init(s); }
119#if HAVE_WORKING_REGEX
125 std::string pattern()
const {
return d_pattern; }
128 int match(
const char *s,
int len,
int pos = 0)
const;
130 int match(
const std::string &s)
const;
133 int search(
const char *s,
int len,
int &matchlen,
int pos = 0)
const ;
135 int search(
const std::string &s,
int &matchlen)
const;
Regular expression matching.
BESRegex(const char *s)
initialize a BESRegex with a C string
int match(const char *s, int len, int pos=0) const
Does the pattern match.
BESRegex(const std::string &s)
initialize a BESRegex with a C++ string
int search(const char *s, int len, int &matchlen, int pos=0) const
Where does the pattern match.
BESRegex(const char *s, int)