#include <iostream>
#include <string>
#include <regex>
using namespace std;
int main(){
try{
string input("(66+89i)+(12+5i)");
regex re(R"~~~((\d+)([+-]?[\di]+)\)([+*=/!-]+)\((\d+)([+-]?[\di]+))~~~");
smatch match;
if (regex_search(input, match, re)) {
cout << "x1 : " << match.str(1)<<endl;
cout << "y1 : " << match.str(2)<<endl;
cout << "operator : " << match.str(3)<<endl;
cout << "x2 : " << match.str(4)<<endl;
cout << "y2 : " << match.str(5)<<endl;
}
else {
cout << "No match is found" << endl;
}
} catch (std::regex_error r) {
cout<<r.what();
}
return 0;
}