Below program output is "It is not matching" but ideally it should be "It is matching" ?
#include <iostream>
#include <string>
#include <regex>
using namespace std;
using namespace regex_constants;
int main()
{
string pattern = "[a]*";
try {
regex re(pattern, extended);
if(regex_match("aaaa", re))
cout << "It is matching" << endl;
else
cout << "It is not matching" << endl;
}catch(regex_error &e)
{
cout << e.what() << endl;
}
return 0;
}