I'm studying regular expressions in c++11 and this regex search is returning false. Does anybody know what I am doing wrong here? . I know that .*
stands for any number of characters except newlines.
So i was expecting regex_match() to return true and the output to be "found". However the output is coming out to be "not found".
#include<regex>
#include<iostream>
using namespace std;
int main()
{
bool found = regex_match("<html>",regex("h.*l"));// works for "<.*>"
cout<<(found?"found":"not found");
return 0;
}