可能重复:
关于正则表达式的gcc4.7错误吗?
我用"g ++ test.cpp -std = gnu ++ 0x"编译下面的代码.编译是成功的,但是当我运行./a.out时,它会给出错误,就像我不明白它为什么会发生一样.我的操作系统是Mint.
错误:"在抛出'std :: regex_error'的实例后调用终止what():regex_error Aborted(core dumped)"
Code:
// regex_match example
#include <iostream>
#include <string>
#include <regex>
using namespace std;
int main ()
{
string s ("this subject has a submarine as a subsequence");
regex e("sub[a-z]"); // matches words beginning by "sub"
smatch m;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2362 次 |
| 最近记录: |