Regular expressions using the glibc regex library.
More...
|
bool | regex_match (const char *s, smatch &matches, const regex ®ex) |
| Regular expression matching. 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 char * |
s, |
|
|
smatch & |
matches, |
|
|
const regex & |
regex |
|
) |
| |
|
related |
Regular expression matching.
Return whether a regex matches a specific string. An optionally passed smatch object will contain the match reults.