1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
// basic_regex::imbue
// note: using regex, a standard alias of basic_regex<char>
#include <iostream>
#include <regex>
#include <locale>
int main ()
{
std::regex myregex;
myregex.imbue (std::locale::classic());
myregex.assign ("sub[a-z]*");
if (std::regex_match ("subject", myregex))
std::cout << "The string matches." << std::endl;
return 0;
}
| |