23 : m_flags(match_extended)
36 static const int normal = 1<<16;
37 if (!(flags & normal)) {
42 if ((err = regcomp(&
m_preg, str.c_str(), flags))) {
44 regerror(err, &
m_preg, errbuff,
sizeof(errbuff));
70 return s && !regexec(®ex.
m_preg, s, 0, NULL, 0);
75 memset(&pmatch, -1,
sizeof(pmatch));
80 if ( i <
sizeof(pmatch)/
sizeof(*pmatch) && pmatch[i].rm_so != -1 )
81 return match_str.substr( pmatch[i].rm_so, pmatch[i].rm_eo-pmatch[i].rm_so );
87 {
return( i <
sizeof(pmatch)/
sizeof(*pmatch) && pmatch[i].rm_so != -1 ? pmatch[i].rm_so : std::string::npos ); }
90 {
return( i <
sizeof(pmatch)/
sizeof(*pmatch) && pmatch[i].rm_so != -1 ? pmatch[i].rm_eo : std::string::npos ); }
93 {
return( i <
sizeof(pmatch)/
sizeof(*pmatch) && pmatch[i].rm_so != -1 ? pmatch[i].rm_eo-pmatch[i].rm_so : std::string::npos ); }
97 unsigned matches = unsigned(-1);
101 for (
unsigned i = 0; i <
sizeof(pmatch)/
sizeof(*pmatch); ++i )
103 if ( pmatch[i].rm_so != -1 )
#define ZYPP_THROW(EXCPT)
Drops a logline and throws the Exception.
std::string::size_type begin(unsigned i) const
Begin index of subexpression i in match_str (or std::string::npos)
String related utilities and Regular expression matching.
std::string operator[](unsigned i) const
String related utilities and Regular expression matching.
Regular expression match result.
Use POSIX Extended Regular Expression syntax when interpreting regex.
void assign(const std::string &s, int flags=match_extended)
bool regex_match(const std::string &s, smatch &matches, const regex ®ex)
regex ZYPP_STR_REGEX regex ZYPP_STR_REGEX
std::string::size_type end(unsigned i) const
End index of subexpression i in match_str (or std::string::npos)
Easy-to use interface to the ZYPP dependency resolver.