10 #define _gu_regex_hpp_
16 #include "gu_throw.hpp"
24 std::string strerror (
int rc)
const;
31 RegEx (
const std::string& expr) : regex()
35 if ((rc = regcomp(®ex, expr.c_str(), REG_EXTENDED)) != 0)
37 gu_throw_fatal <<
"regcomp(" << expr <<
"): " << strerror(rc);
57 Match() : value(), set(
false) {}
58 Match(
const std::string& s) : value(s), set(
true) {}
61 const std::string& str()
const
63 if (set)
return value;
68 bool is_set()
const {
return set; }
80 match (
const std::string& str,
size_t num)
const;
Definition: gu_regex.hpp:20
Definition: gu_regex.hpp:50
RegEx(const std::string &expr)
Definition: gu_regex.hpp:31
std::vector< Match > match(const std::string &str, size_t num) const
Matches given string.
Definition: gu_exception.hpp:16