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

int main() {
	const std::string text = "This is a test string [more or less] and here is [another].";
	const std::regex ws_re(R"(\[([^\]\[]*)\])");
	std::copy( std::sregex_token_iterator(text.begin(), text.end(), ws_re, 1),
           std::sregex_token_iterator(),
           std::ostream_iterator<std::string>(std::cout, "\n"));
    
	return 0;
}
