12 #ifndef ZYPP_BASE_REGEX_H 13 #define ZYPP_BASE_REGEX_H 19 #include <zypp-core/base/Exception.h> 74 bool regex_match(
const char * s,
const regex & regex );
86 std::string
regex_substitute (
const std::string & s,
const regex & regex,
const std::string &replacement,
bool global =
true );
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 );
174 unsigned size()
const;
193 #endif // ZYPP_BASE_STRING_H
std::string regex_substitute(const std::string &s, const regex ®ex, const std::string &replacement, bool global=true)
Replaces the matched regex with the string passed in replacement.
regex(const char *s, int flags=rxdefault)
String related utilities and Regular expression matching.
std::ostream & operator<<(std::ostream &str, const regex &obj)
std::string::size_type end(unsigned i) const
End index of subexpression i in match_str (or std::string::npos)
std::string::size_type begin(unsigned i) const
Begin index of subexpression i in match_str (or std::string::npos)
void assign(const std::string &s, int flags)
Support for substring addressing of matches is not required.
Do not differentiate case.
Do not match begin of line.
bool matches(const std::string &s_r, str::smatch &matches_r, int flags_r=none) const
bool matches(const std::string &s_r) const
bool matches(const char *s, str::smatch &matches, int flags=none) const
regex & operator=(const regex &rhs)
Regular expression match result.
Base class for Exception.
Use POSIX Extended Regular Expression syntax when interpreting regex.
std::string operator[](unsigned i) const
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
These are enforced even if you don't pass them as flag argument.
std::vector< regmatch_t > pmatch
Easy-to use interface to the ZYPP dependency resolver.