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

int main() {
	std::string regexp_string(R"(([a-z])\1)");
	std::regex regexp_to_match(regexp_string);
	std::string target("abbab");
	std::smatch matched_regexp;
	if (std::regex_search(target, matched_regexp, regexp_to_match)) {
		std::cout << matched_regexp.str() << std::endl;
	}
	return 0;
}