#include "Utils.hpp" #include #include #include #include #include std::locale utf8loc(std::locale(), new std::codecvt_utf8); using namespace std; int main(int argc, char **argv) { setlocale(LC_ALL, "en_US.UTF-8"); wcout.imbue(utf8loc); wcin.imbue(utf8loc); wstring const str = L"Four score and seven years ago..."; wcout << L"Split 1: " << Utils::to_wstring(Utils::split(wregex(L" "), str)) << endl; wcout << L"Split 2: " << Utils::to_wstring(Utils::split(wregex(L"[eo]"), str)) << endl; wcout << L"Split 3: " << Utils::to_wstring(Utils::split(wregex(L"\\s"), str)) << endl; wcout << L"Split 4: " << Utils::to_wstring(Utils::split(wregex(L"\\W"), str)) << endl; return 0; }