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;
}
bool regex_match(const std::string &s, smatch &matches, const regex ®ex)
\relates regex \ingroup ZYPP_STR_REGEX \relates regex \ingroup ZYPP_STR_REGEX
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
◆ regex_match()
Regular expression matching.
Return whether a regex matches a specific string. An optionally passed smatch object will contain the match reults.