小编Dav*_*ech的帖子

使用eclipse在c ++中编译和正则表达式

所以我的教授给了我一个用c ++编写的正则表达式.

所以我试着在eclipse中编写我的代码(我正在使用linux(ubuntu 12.04)).

所以我拿了代码:

   // regex_search example
#include <iostream>
#include <string>
#include <regex>

int main ()
{
  std::string s ("this subject has a submarine as a subsequence");
  std::smatch m;
  std::regex e ("\\b(sub)([^ ]*)");   // matches words beginning by "sub"

  std::cout << "Target sequence: " << s << std::endl;
  std::cout << "Regular expression: /\\b(sub)([^ ]*)/" << std::endl;
  std::cout << "The following matches and submatches were found:" << std::endl;

  while (std::regex_search (s,m,e)) {
    for (auto x:m) std::cout << x << " …
Run Code Online (Sandbox Code Playgroud)

c++ regex eclipse compiler-errors eclipse-cdt

5
推荐指数
1
解决办法
3651
查看次数

标签 统计

c++ ×1

compiler-errors ×1

eclipse ×1

eclipse-cdt ×1

regex ×1