#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="((?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Sept|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?))";
std::string re3=".*?";
std::string re4=" ";
std::string re5=".*?";
std::string re6="( )";
PME re(re1+re2+re3+re4+re5+re6,"gims");
int n;
if ((n=re.match(txt))>0)
{
std::string month1=re[1].c_str();
std::string ws1=re[2].c_str();
std::cout << "("<<month1<<")"<<"("<<ws1<<")"<< std::endl;
}
}
|