【发布时间】:2020-09-25 06:29:20
【问题描述】:
给定以下代码:
std::string str;
str= std::regex_replace(str, std::regex("\r"), ""); // ERROR
我收到以下错误: no matching function for call to ‘regex_replace(std::string&, std::regex, const char [1])’
我该如何解决这个错误?
【问题讨论】:
-
很幼稚的问题,但你记得导入
<regex>吗? -
我写了
#include <regex> -
Works for me。有问题的话,一定是代码没有显示出来。准备一个minimal reproducible example
标签: regex c++11 compiler-errors