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