+ 5

Help! Where is the bracket error?

I have the code: #include <iostream> #include <regex> using namespace std; int main() { string var; getline(cin,var); const regex pattern ("^[a-z_A-Z]\\w*

quot;); if(regex_match(var,pattern)) cout<<"Yes"; else cout<<"No"; } However, the program returns a regex_error on compilation. To further find the error's cause, I added a catch call, and found it to be a error_brack. But I am unable to find the mismatched bracket pair. Please help me find the reason for the error...

29th Nov 2017, 5:58 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
3 ответов
+ 4
Thank You everyone. When the code failed on Sololearn's Code Playground, I ran it on CppDroid. But even there the code failed. Perhaps its because it uses gcc4.8. Ill run it on Code::Blocks...
29th Nov 2017, 9:11 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar