This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]