#include<iostream> #include<regex> #include<string.h> using namespace std; void main() { string E1 ; cout << "Enter a sentence E1 : " << endl; getline(cin, E1); regex r("\\[+ [a-z]*||([A-Za-z]*||(\\[+\\] )+\\, +\\]"); bool b = regex_match(E1, r); cout <<( b ? "T":"f")<< endl; system("pause"); } input: [A,nana,12,[],[as,45,Ad]] output:match
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)