c++11 - 在 C++ 中删除表情
问题描述
我正在尝试从 C++ 中的字符串中删除表情符号。我已经尝试过正则表达式,但无法做到。
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";
解决方案
推荐阅读
- python-3.x - 如何创建一个数据框,其中一列的输入是动态的并通过依赖于该列中另一个条目的 IF 语句派生
- c++ - QVariant 可以与 QMatrix4x4 和 QVector3D 等一起使用吗
- javafx - JavaFX 跳转字符
- c# - 仅发布检查值查看模型
- javascript - 如何使用表情符号而不是星号(VueJS)隐藏密码
- javascript - 检查一个 curried 函数是否仍然需要进一步的参数
- python - 第一个客户端无法连接到服务器
- javascript - 为什么我必须单击两次才能在搜索结果菜单中获取链接才能加载页面?
- python - 我如何在 Windows 服务器上部署 RESTful Api Flask
- python - LCS问题的给定解决方案有什么问题?