9 #ifndef _STRUS_BASE_REGEX_HPP_INCLUDED
10 #define _STRUS_BASE_REGEX_HPP_INCLUDED
16 class ErrorBufferInterface;
50 Match
find(
const char* begin,
const char* end)
const;
56 int match_start(
const char* begin,
const char* end)
const;
59 #if __cplusplus >= 201103L
69 ErrorBufferInterface* m_errhnd;
89 bool exec( std::string& out,
const std::string& input)
const;
96 bool exec( std::string& out,
const char* src, std::size_t srcsize)
const;
99 const char*
error()
const;
102 #if __cplusplus >= 201103L
111 void reportError(
const char* err);
bool valid() const
Definition: regex.hpp:36
~RegexSearch()
Destructor.
Match(int pos_, int len_)
Definition: regex.hpp:30
Match()
Definition: regex.hpp:28
Match find(const char *begin, const char *end) const
Execute the search.
Interface for reporting and catching errors in modules.
Definition: errorBufferInterface.hpp:24
Match & operator=(const Match &o)
Definition: regex.hpp:34
RegexSubst(const std::string &expression, const std::string &fmtstring, ErrorBufferInterface *errhnd_)
Constructor.
const char * error() const
Class to replace a regular expression by a string with sub-matches as substitute. ...
Definition: regex.hpp:75
int len
length of the match in bytes
Definition: regex.hpp:26
RegexSearch(const std::string &expression, int index, ErrorBufferInterface *errhnd_)
Constructor.
bool exec(std::string &out, const std::string &input) const
Execute the replacement.
int pos
offset of the match in bytes from the start of the search or -1 if not found
Definition: regex.hpp:25
int match_start(const char *begin, const char *end) const
Match the regex to the start of the source.
Class to search for a regular expression.
Definition: regex.hpp:20
Match(const Match &o)
Definition: regex.hpp:32