Line-Following-Robot/Socket/lfr_socket.cpp

18 lines
385 B
C++
Raw Normal View History

2023-01-11 16:21:09 +01:00
#include "lfr_socket.h"
#include <boost/regex.hpp>
#include <iostream>
#include <string>
int main()
{
std::string line;
boost::regex pat( "^Subject: (Re: |Aw: )*(.*)" );
while (std::cin)
{
std::getline(std::cin, line);
boost::smatch matches;
if (boost::regex_match(line, matches, pat))
std::cout << matches[2] << std::endl;
}
}