// from https://github.com/sol-prog/regex_tutorial #include #include #include using namespace std; int main() { string input; // traditional pcre escape regex int_re {"(\\+|-)?\\d+"}; // ecmascript regex float_re {"((\\+|-)?[[:digit:]]+)(\\.(([[:digit:]]+)?))?((e|E)((\\+|-)?)[[:digit:]]+)?"}; while(cin >> input){ if (regex_match(input, int_re)) { cout << "integer" << endl; } else if(regex_match(input, float_re)) { cout << "float" << endl; } else { cout << "nan" <