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

int main() {
	string str("abcdefabcghiabc");
	int i = 0;
	regex rgx1("abc");
	smatch smtch;
	while (regex_search(str, smtch, rgx1)) {
			std::cout << i << ": " << smtch[0] << std::endl;
			i += 1;
			str = smtch.suffix().str();
		}

	return 0;
}


