#include <iostream>
#include <ostream>
#include <regex>
#include <string>
using namespace std;
int main() {
const regex pattern("([\\w ])(?!\\1)");
string s = "ssha3akjssss42jj 234444 203488842882387 heeelloooo";
string result;
for (sregex_iterator i(s.begin(), s.end(), pattern), end; i != end; ++i)
result.append((*i)[0].str());
cout << result << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8b3N0cmVhbT4KI2luY2x1ZGUgPHJlZ2V4PgojaW5jbHVkZSA8c3RyaW5nPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7Cgljb25zdCByZWdleCBwYXR0ZXJuKCIoW1xcdyBdKSg/IVxcMSkiKTsKCXN0cmluZyBzID0gInNzaGEzYWtqc3NzczQyamogMjM0NDQ0IDIwMzQ4ODg0Mjg4MjM4NyBoZWVlbGxvb29vIjsKCXN0cmluZyByZXN1bHQ7CgoJZm9yIChzcmVnZXhfaXRlcmF0b3IgaShzLmJlZ2luKCksIHMuZW5kKCksIHBhdHRlcm4pLCBlbmQ7IGkgIT0gZW5kOyArK2kpCgkJcmVzdWx0LmFwcGVuZCgoKmkpWzBdLnN0cigpKTsKCgljb3V0IDw8IHJlc3VsdCA8PCBlbmRsOwoJCglyZXR1cm4gMDsKfQ==
/home/O4H2FI/ccYmd6EM.o: In function `main':
prog.cpp:(.text.startup+0xd5): undefined reference to `std::regex_iterator<__gnu_cxx::__normal_iterator<char const*, std::string>, char, std::regex_traits<char> >::regex_iterator(__gnu_cxx::__normal_iterator<char const*, std::string>, __gnu_cxx::__normal_iterator<char const*, std::string>, std::basic_regex<char, std::regex_traits<char> > const&, std::bitset<11u>)'
prog.cpp:(.text.startup+0xdd): undefined reference to `std::regex_iterator<__gnu_cxx::__normal_iterator<char const*, std::string>, char, std::regex_traits<char> >::regex_iterator()'
prog.cpp:(.text.startup+0x173): undefined reference to `std::regex_iterator<__gnu_cxx::__normal_iterator<char const*, std::string>, char, std::regex_traits<char> >::operator++()'
prog.cpp:(.text.startup+0x17f): undefined reference to `std::regex_iterator<__gnu_cxx::__normal_iterator<char const*, std::string>, char, std::regex_traits<char> >::operator!=(std::regex_iterator<__gnu_cxx::__normal_iterator<char const*, std::string>, char, std::regex_traits<char> > const&)'
prog.cpp:(.text.startup+0x18b): undefined reference to `std::regex_iterator<__gnu_cxx::__normal_iterator<char const*, std::string>, char, std::regex_traits<char> >::operator*()'
collect2: error: ld returned 1 exit status