jeudi 12 décembre 2019

Removing emoticions in C++

I am trying to remove emoticons from a string in c++. I have tried regex but unable to do it.

const std::string text = "What are 😀 you doing today 😄.";
const std::regex emoji("[\u1F600|U+1F604]");

std::stringstream result;
std::regex_replace(std::ostream_iterator<char>(result), text.begin(), text.end(), emoji, "");

std::cout << result.str()+"\n";

Aucun commentaire:

Enregistrer un commentaire