12 #ifndef REGEXPREPROCESSOR_H 13 #define REGEXPREPROCESSOR_H 19 #include <boost/regex.hpp> 28 const static std::string ERR_OUTER_UNMARKED;
29 const static std::string ERR_NESTED_SUBEXP;
30 const static std::string ERR_UNBALANCED_PAREN;
31 const static std::string ERR_OUTSIDE_SUBEXP;
78 static const std::string preprocess(
const std::string &s);
85 static const std::string make_nonsensitive(
const std::string &s);
93 static unsigned int num_of_subexpressions(
const std::string &s);
109 const std::string &s,
bool allow_outer_char =
false,
110 bool allow_outer_nonmarked =
false);
121 static const subexpressions_strings *split_marked_subexpressions(
122 const std::string &s);
132 static bool contains_backreferences(
const std::string &s);
141 static backreference_info num_of_backreferences(
const std::string &s);
151 static backreference_info num_of_references(
const std::string &s);
164 static const std::string replace_backreferences(
165 const std::string &original,
166 const backreference_replacements &replace);
181 static const std::string replace_backreferences(
182 const std::string &original,
const regex_match_results &results);
193 static const std::string replace_references(
194 const std::string &original,
195 const backreference_replacements &replace);
208 static const std::string replace_references(
209 const std::string &original,
const regex_match_results &results);
std::pair< int, int > backreference_info
Information about backreferences; the first elem contains the number of backreferences and the second...
Definition: regexpreprocessor.h:53
Definition: regexpreprocessor.h:27
preprocess a regular expression, e.g., transform "()" into "(?:)"
Definition: regexpreprocessor.h:68
C++ class: doctemplate.h.
Definition: bufferedoutput.cpp:13
boost::match_results< std::string::const_iterator > regex_match_results
The result of boost::regex_search.
Definition: regexpreprocessor.h:63
unsigned int marked
num of marked subexpressions
Definition: regexpreprocessor.h:34
std::vector< std::string > backreference_replacements
What to replace to backreferences in a regular expression.
Definition: regexpreprocessor.h:58
std::string errors
error specifications, if any
Definition: regexpreprocessor.h:36
std::list< std::string > subexpressions_strings
all the marked subexpressions in a list
Definition: regexpreprocessor.h:46