libzypp
10.5.0
|
Regular expressions using the glibc regex library. More...
Classes | |
class | zypp::str::regex |
Regular expression. More... | |
class | zypp::str::smatch |
Regular expression match result. More... | |
Functions | |
bool | regex_match (const char *s, smatch &matches, const regex ®ex) |
Regular expression matching. | |
bool | regex_match (const std::string &s, smatch &matches, const regex ®ex) |
bool | regex_match (const char *s, const regex ®ex) |
bool | regex_match (const std::string &s, const regex ®ex) |
Regular expressions using the glibc regex library.
str::regex rxexpr( "^(A)?([0-9]*) im" ); str::smatch what; std::string mytext( "Y123 imXXXX" ); if ( str::regex_match( mytext, what, rxexpr ) ) { MIL << "MATCH '" << what[0] << "'" << endl; MIL << " subs: " << what.size()-1 << endl; for_( i, 1U, what.size() ) MIL << " [" << i << "] " << what[i] << endl; } else { WAR << "NO MATCH '" << rxexpr << "' in '" << mytext << endl; }
bool regex_match | ( | const char * | s, |
const regex & | regex | ||
) | [related] |