I am facing a weird problem which is boost::regex_match gives all NULLs results.
Sorry for the bad problem description. Let me copy and paste the code below.
I think the boost lib version should be Boost 1-47-0. GCC 4.3.2 on Linux.
#include <iostream>
#include <string>
#include <boost/regex.hpp>
using namespace std;
int main()
{
string aFreeText = "26JAN07";
boost::regex expression("([0-9]{2}[A-Z]{3}[0-9]{2})");
boost::smatch results;
if(boost::regex_match(aFreeText, results, expression))
{
for(int index=0; index<results.size(); index++)
DEBUG("YI JI results[" << index << "].str(): " << results[index].str());
}
return 0;
}
However, in the log, the display is very weird.
Can anyone kindly help me with this problem? Your kind help will be greatly appreciated.
If the provided information is not enough, please feel free to leave your comment and I will add them later.