#include<iostream> #include<string> #include<regex> using namespace std; int main() { string s ; cout << "Enter a sentence to check: "; std::getline(cin, s); regex re("^(a-z)+\(+(a-z)+\,+(a-z)+\) $"); bool m = regex_match(s,re); cout <<( m ? "atomic":"other") << endl; system("pause"); return 0; }
^(a-z)+\(+(a-z)+\,+(a-z)+\) $
^[a-z]+\(+[a-z]+\,+[a-z]+\);$
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)