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

int main() {
	std::regex rx(R"(&&|\|\||[();])");
	std::string exp = "a < b | c | d > e >> f && ((g) || h) ; i";
	std::sregex_token_iterator srti(exp.begin(), exp.end(), rx, {-1, 0});
	std::vector<std::string> tokens;
	std::remove_copy_if(srti, std::sregex_token_iterator(), 
                    std::back_inserter(tokens),
                    [](std::string const &s) { return s.empty(); });
    for( auto & p : tokens ) std::cout <<"'"<< p <<"'"<< std::endl;
    return 0;
}