I'm new to regular expressions in C++ and was wondering if anyone could tell me what I'm doing wrong here, i'm trying to make a regular expression match a html element, using the code i have i can make it match in all cases except where there is whitespace separating the content from the tags
string opening_tag = "(<[[:alpha:]]+>)";
string content = "([\\w ]*)"; // zero or more characters or spaces
string closing_tag = "(</[[:alpha:]]+>)";
string html_element = opening_tag + content + closing_tag;
regex r(html_element);
string s;
while (cin >> s)
{
if (regex_match(s, r))
{
cout << "matched" << endl;
}
}