vendredi 17 avril 2015

Regex in C++11 vs PHP

I'm new to regex and C++11. In order to match an expression like this :


TYPE SIZE NUMBER ("regina s x99");


I built a regex which looks like this one :


\b(regina|margarita|americaine|fantasia)\b \b(s|l|m|xl|xxl)\b x([1-9])([0-9])


In my code I did this to try the regex :



std::string s("regina s x99");
std::regex rgx($RGX); //$RGX corresponds to the regex above
if (std::reegex_match(s, rgx))
std::cout << "It works !" << std::endl;


This code throw a std::regex_error, but I don't know where it comes from..


Thanks,


Aucun commentaire:

Enregistrer un commentaire