I am trying to follow the example here:
http://www.boost.org/doc/libs/1_31_0/libs/regex/doc/syntax.html
I want to match lines of this form:
[ foo77 ]
which should be simple enough, I tried a code snippet like this:
boost::regex rx("^\[ (.+) \]");
boost::cmatch what;
if (boost::regex_match(line.c_str(), what, rx)) std::cout << line << std::endl;
but I am not matching those lines. I tried the following variant expressions:
"^\[[:space:]+(.+)[:space:]+\]$" //matches nothing
"^\[[:space:]+(.+)[:space:]+\]$" //matches other lines but not the ones I want.
what am I doing wrong?