1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
// basic_regex::flags
// note: using regex, a standard alias of basic_regex<char>
#include <iostream>
#include <regex>
int main ()
{
using namespace std::regex_constants;
std::regex first ("[a-z]+");
std::regex second ("[a-z]+", ECMAScript | icase );
std::cout << "first ";
std::cout << ( ( first.flags() & icase ) == icase ? "is":"is not");
std::cout << " case insensitive.\n";
std::cout << "second ";
std::cout << ( ( second.flags() & icase ) == icase ? "is":"is not");
std::cout << " case insensitive.\n";
return 0;
}
|