Actually, I try to find a regular expression in a multilines string, but I think I'm on the wrong way to find the next regular expression after a new line (equals to a '\n'). Here is my regex :
#include <iostream>
#include <fstream>
#include <sstream>
#include <regex>
#define USE ".*[0-9]{2}\\.[0-9]{2}\\.[0-9]{2}\\.[0-9]{2}\\.[0-9]{2}.*(?:\\n)*"
int main(int argc, char **argv)
{
std::stringstream stream;
std::filebuf *buffer;
std::fstream fs;
std::string str;
std::regex regex(USE);
if (argc != 2)
{
std::cerr << "Think to the use !" << std::endl;
return (-1);
}
fs.open(argv[1]);
if (fs)
{
stream << (buffer = fs.rdbuf());
str = stream.str();
if (std::regex_match(str, regex))
std::cout << "Yes" << std::endl;
else
std::cout << "No" << std::endl;
fs.close();
}
return (0);
}