simple-cpp-game-study/PPP3/goc.cpp

31 lines
667 B
C++

#include <iostream>
#include <fmt/core.h>
#include <regex>
#include <string>
#include <iterator>
using namespace std;
using namespace fmt;
int main()
{
regex err_re("(.*?):([0-9]+):([0-9]+):\\s*(.*?):\\s*(.*)");
string line;
smatch err_match;
while(getline(cin, line)) {
print("{}\n", line);
if(regex_match(line, err_match, err_re)) {
string file_name = err_match[1].str();
string line = err_match[2].str();
string col = err_match[3].str();
string type = err_match[4].str();
string message = err_match[5].str();
print("{},{},{},{},{}\n",
file_name, line, col, type, message);
}
}
return 0;
}