Need help figuring out how to extract text from context (Honda from str), need something analogous to Perl regex
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char* argv[]) {
string str;
str = "<make>Honda</make>";
//Code to extract Honda from above string
cout<<str<<endl;
cin.get();
return 0;
}
Is this a trick question? 🙂 That “something” is PCRE: “Perl-Compatible Regular Expressions”.
What you really need is
libxml2, and the XPath query//meta/text().