You should not call match.size () before checking that something has been matched, i.e. your code should look something like this:
#include <boost/regex.hpp>
boost::cmatch matches;
if (boost::regex_match("alpha beta", matches, boost::regex("([a-z])+")))
cout << "found: " << matches.size() << endl;
else
cout << "nothing found" << endl;
" ", regex_match . , , regex_search, . :
#include <boost/regex.hpp>
boost::cmatch matches;
if (boost::regex_search("alpha beta", matches, boost::regex("([a-z])+")))
cout << "found: " << matches.size() << endl;
else
cout << "nothing found" << endl;
"2", .. [0] "" [1] "a" ( - )
, ([a-z] +) regex_search, .
, 2 , - , , , , - ...