I want to remove the emojis from a json Telegram bot update parsed with boost property tree
I tried to use the regex pattern from this answer and a few others but I'm not sure how to get them to work in C++ (the below causes a crash): https://stackoverflow.com/a/24674266/2212021
"message":{
"message_id":123,
"from":{
"id":12345,
"first_name":"name",
"username":"username"
},
"chat":{
"id":12345,
"first_name":"name",
"username":"username",
"type":"private"
},
"date":1478144459,
"text":"this is \ud83d\udca9 a sentence"
}
BOOST_FOREACH(const boost::property_tree::ptree::value_type& child, jsontree.get_child("result"))
{
std::string message(child.second.get<std::string>("message.text").c_str());
boost::regex exp("/[\u{1F600}-\u{1F6FF}]/");
std::string message_clean = regex_replace(message, exp, "");
...
}
Exception thrown at 0x00007FF87C1C7788 in CrysisWarsDedicatedServer.exe: Microsoft C++ exception: boost::exception_detail::clone_impl > at memory location 0x000000001003F138. Unhandled exception at 0x00007FF87C1C7788 in CrysisWarsDedicatedServer.exe: Microsoft C++ exception: boost::exception_detail::clone_impl > at memory location 0x000000001003F138.