I use boost libraries since my debian gcc version 4.7.2 isn't compiled with the latest c11++ standard.
My question is : why cannot I retrieve all the results of a string out of a regex (i read a lot about tokens, but don't get it, I started c++ coding 3 days ago :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
typedef std::istreambuf_iterator<char> iter;
string c;
std::ifstream input_file("myfile.txt");
iter file_begin(input_file);
iter file_end;
staticconst boost::regex first_regex("(tommy=^[\"](\w)*[\"]$)*");
boost::smatch str_matches;
for (iter i = file_begin; i != file_end; ++i)
c+= *i;
if (boost::regex_search(c, str_matches, first_regex))
{
cout << "ok";
}