/******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <iostream>
#include <regex>
int main()
{
std::regex fnTypeDefRgx("([a-zA-Z_][a-zA-Z0-9_*]*)\\s*(?:([a-zA-Z_][a-zA-Z0-9_*]*)?\\s*)?(?:[a-zA-Z_][a-zA-Z0-9_]*)?\\s*\\((.*)\\)");
std::smatch matches;
std::string input = "void stdcall (char*, float, uint8_t)";
if (std::regex_search(input, matches, fnTypeDefRgx)) {
std::string retType = matches[1].str();
std::string callConv = matches[2].str(); // this guy is 'false' WTF
std::cout << callConv << std::endl;
}
return 0;
}