【问题标题】:Regex replace not replacing anything正则表达式替换不替换任何东西
【发布时间】:2022-06-15 00:37:34
【问题描述】:

name 的值为:regex101: build, test, and debug regex - 3 running windows 我正在尝试删除最后一个 -

的所有内容
        std::wstring name = accvector[i].name;
        std::wregex regexp(L".*\\K( -\\s+\\d+\\srunning.*$)");
        name = std::regex_replace(name, regexp, L"");

什么都没有被替换,怎么了?

【问题讨论】:

  • \K 仅受 Boost/PCRE/Onigmo 正则表达式支持,ECMAScript 不支持。

标签: c++ regex


猜你喜欢
  • 1970-01-01
  • 2017-03-28
  • 1970-01-01
  • 1970-01-01
  • 2014-10-27
  • 2011-09-23
  • 2013-08-21
  • 2016-07-17
  • 1970-01-01
相关资源
最近更新 更多