#include <stdlib.h>
#include <string>
#include <iostream>
#include <pme.h>
int main()
{
std::string txt="11:Feb:2019 \"This is an Example!\"";
std::string re1=".*?";
std::string re2="(2019)";
PME re(re1+re2,"gims");
int n;
if ((n=re.match(txt))>0)
{
std::string year1=re[1].c_str();
std::cout << "("<<year1<<")"<< std::endl;
}
}
|