Hi, I'm having trouble when I'm trying to run regular expression code. It compiled fine but when I run it in CodeBlocks I'm getting this error
terminate called after throwing an instance of 'std::regex_error' what[]: regex_error Aborted [core dumped]
Here is the code [taken from //www.cplusplus.com/reference/] As you can see it work fine on cpp.sh. And yes I did enable C++11 support. Anyone know what the problem might be?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# include
# include
# include
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