This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Regex locale support
- From: Stefan <stefan at schweter dot it>
- To: libstdc++ at gcc dot gnu dot org
- Date: Wed, 21 Aug 2013 13:36:52 +0200
- Subject: Regex locale support
Hi,
I'm using the 4.9.0 (20130818) version and hopefully someone can help
me with that code:
#include <iostream>
#include <regex>
int main()
{
std::setlocale(LC_ALL, "");
std::wstring str2 = L"ÃBER";
std::wregex re2;
re2.imbue(std::locale(""));
re2.assign(L"[[:upper:]]*", std::regex::extended);
std::wsmatch m2;
if (std::regex_match(str2, m2, re2)) {
std::wcout << L"Matches!" << std::endl;
}
return 0;
}
I'm trying to get str2 matched with locale support (Console locale is
de_DE.UTF-8 and the "Ã" is an uppercase letter in "my" locale ;) )
regex_match does not match, is it because the gcc version does
not support it yet, or am I doing something fundamental wrong?
Thanks in advance,
Stefan