Regular expressions using the glibc regex library.
More...
Regular expressions using the glibc regex library.
- See also
- also StrMatcher string matcher also supporting globing, etc.
str::regex rxexpr( "^(A)?([0-9]*) im" );
str::smatch what;
std::string mytext( "Y123 imXXXX" );
{
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;
}
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
bool regex_match(const char *s, smatch &matches, const regex ®ex) ZYPP_API
Regular expression matching.
◆ regex_match()
| bool zypp::str::regex_match |
( |
const char * | s, |
|
|
smatch & | matches, |
|
|
const regex & | regex ) |
Regular expression matching.
relates: regex Return whether a regex matches a specific string. An optionally passed smatch object will contain the match reults.
Definition at line 80 of file Regex.cc.