mardi 30 juin 2015

can't run the program compiled usig minGW in windows using regex c++11 std

This program compiles fine without any error but when i run the program it exits unexpectedly saying it ran into some problem .

Analyzing using gdb the program runs into segmentation fault. I dont know much about gdb so can't examine thoroughly if somebody can reproduce the problem and explain the error that will be helpful.

Also what can i do to rectify the problem.

#include<iostream>
#include<regex>
#include<string>
using namespace std;

int main()
{
   bool found;
   cmatch m;
try
{
    found = regex_search("<html>blah blah blah </html>",m,regex("<.*>.* </\\1"));
    cout<< found<<endl<<m.str();
}
catch(exception & e)
{

    cout<<e.what();
}

return 0;


}

Aucun commentaire:

Enregistrer un commentaire