
I am struggling with a regex in some code of mine.
I want to use regex_search to look for a match in a std::string, but my
code will not build.
This is a snippet of what I am trying to do.
using namespace std;
string in_file_name_s;
string date_and_time_s;
string day_s;
char input_line[5000];
boost::regex re_date_time("(.*-.*-.*:.*:.*),.*,.*,.*,.*,.*,.*,.*,.*,");
boost::regex re_pices_date_time("(.*)\\-(.*)\\-(.*) (.*)");
boost::cmatch match;
while (inFile.getline(input_line , 5000))
{
if (boost::regex_search(input_line, match , re_date_time ))
{
date_and_time_s = match[1];
if (boost::regex_search(date_and_time_s , match ,
re_pices_date_time ))
{
day_s = match[1];
}
}
}
When I compile I get the following error
error C2784: 'bool boost::regex_search(const
std::basic_string