#include <iostream>
#include <regex>
using namespace std;

int main() {
	std::string s("regina s x99");
	std::regex rgx("\\b(regina|margarita|americaine|fantasia)\\b\\s*(s|l|m|xl|xxl)\\b\\s*x([1-9]*[0-9])"); 
	smatch result;
	regex_search(s, result, rgx);
	for(size_t i=1; i<result.size(); ++i)
	{
    	cout << "Capture group " << i << ": " << result[i] << endl;
	}
	if (std::regex_match(s, rgx))
		std::cout << "It works !" << std::endl;
	else
		std::cout << "It didn't work !" << std::endl;
	return 0;
}