12 #ifndef ZYPP_BASE_REGEX_H 13 #define ZYPP_BASE_REGEX_H 86 std::string
regex_substitute (
const std::string & s,
const regex & regex,
const std::string &replacement,
bool global =
true )
ZYPP_API;
101 match_extended = REG_EXTENDED,
102 newline = REG_NEWLINE,
103 rxdefault = match_extended|newline
112 regex(
const std::string & s,
int flags = rxdefault );
113 regex(
const char* s,
int flags = rxdefault ) :
regex(
std::string(s?s:
""), flags ) {}
128 bool matches(
const char * s,
str::smatch & matches,
int flags =
none )
const;
130 {
return matches( s_r.c_str(), matches_r, flags_r ); }
132 bool matches(
const char * s )
const;
134 {
return matches( s_r.c_str() ); }
142 void assign(
const std::string & s,
int flags );
149 bool m_valid =
false;
172 std::string operator[](
unsigned i)
const;
174 unsigned size()
const;
193 #endif // ZYPP_BASE_STRING_H
regex(const char *s, int flags=rxdefault)
String related utilities and Regular expression matching.
std::ostream & operator<<(std::ostream &str, const regex &obj)
bool matches(const std::string &s_r, str::smatch &matches_r, int flags_r=none) const
bool matches(const std::string &s_r) const
regex & operator=(const regex &rhs)
std::string regex_substitute(const std::string &s, const regex ®ex, const std::string &replacement, bool global=true) ZYPP_API
Replaces the matched regex with the string passed in replacement.
Regular expression match result.
Base class for Exception.
std::string asString() const
string representation of the regular expression
bool regex_match(const std::string &s, smatch &matches, const regex ®ex)
regex ZYPP_STR_REGEX regex ZYPP_STR_REGEX
std::vector< regmatch_t > pmatch
Easy-to use interface to the ZYPP dependency resolver.