This is a simple game I'm writing to test the idea of using games to teach C++. https://learncodethehardway.com/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

31 lines
667 B

#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;
}