我的代码:boost :: regex_replace()只替换第一次出现,为什么?
#include <string>
#include <boost/algorithm/string/regex.hpp>
std::cout << boost::algorithm::replace_regex_copy(
"{x}{y}", // source string
boost::regex("\\{.*?\\}"), // what to find
std::string("{...}") // what to replace to
);
这是我所看到的:
{…}{y}
因此,只有第一次出现取代。为什么?如何解决它?
非常感谢!:) – yegor256 2010-05-17 10:28:05