Class to replace a regular expression by a string with sub-matches as substitute.
More...
#include <regex.hpp>
Class to replace a regular expression by a string with sub-matches as substitute.
strus::RegexSubst::RegexSubst |
( |
const std::string & |
expression, |
|
|
const std::string & |
fmtstring, |
|
|
ErrorBufferInterface * |
errhnd_ |
|
) |
| |
Constructor.
- Parameters
-
[in] | expression | regular expression string (POSIX) |
[in] | fmtstring | format string for output with '$0' ... '$9' as substitutes for the results |
strus::RegexSubst::~RegexSubst |
( |
| ) |
|
const char* strus::RegexSubst::error |
( |
| ) |
const |
- Parameters
-
[in] | Get | the last error in the constructor |
bool strus::RegexSubst::exec |
( |
std::string & |
out, |
|
|
const std::string & |
input |
|
) |
| const |
Execute the replacement.
- Parameters
-
[out] | out | output string |
[in] | input | input string |
- Returns
- bool true on success, false on failure, error code or message is not provided
bool strus::RegexSubst::exec |
( |
std::string & |
out, |
|
|
const char * |
src, |
|
|
std::size_t |
srcsize |
|
) |
| const |
Execute the replacement.
- Parameters
-
[out] | out | output string |
[in] | src | pointer to input string |
[in] | srcsize | sizeof src in bytes |
- Returns
- bool true on success, false on failure, error code or message is not provided
The documentation for this class was generated from the following file:
- /home/patrick/Projects/github/strusBase/include/strus/base/regex.hpp