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

int main() {
	string str = "Richard ///[][][12345/678910111213141516] was murdered by Ralph Jordan[/[54321/161514131211109876]";
	regex rgx1(R"(([A-Z]\w*\s*\S*)\[(\d+)?(?:\/(\d+))?\])");
	smatch smtch;
	while (regex_search(str, smtch, rgx1)) {
			std::cout << "Name: " << smtch[1] << std::endl;
			std::cout << "ID1: " << smtch[2] << std::endl;
			std::cout << "ID2: " << smtch[3] << std::endl;
			str = smtch.suffix().str();
		}
	return 0;
}