I want to extract tag's inner content. From the following string:
<tag1 val=123>Hello</tag1>
I just want to get
Hello
What I do:
string s = "<tag1 val=123>Hello</tag1>";
regex re("<tag1.*>(.*)</tag1>");
smatch matches;
bool b = regex_match(s, matches, re);
But it returns two matches:
<tag1 val=123>Hello</tag1>
Hello
And when I try to get only 1st captured group like this:
"<tag1.*>(.*)</tag1>\1"
I get zero matches.
Please, advise.