Boostで文字列を正規表現で分割し、区切り文字を結果リストに含めるにはどうすればよいですか?
たとえば、文字列 "1d2" があり、正規表現が "[az]" の場合、(1, d, 2) のベクトルで結果を取得したい
私は持っている:
std::string expression = "1d2";
boost::regex re("[a-z]");
boost::sregex_token_iterator i (expression.begin (),
expression.end (),
re);
boost::sregex_token_iterator j;
std::vector <std::string> splitResults;
std::copy (i, j, std::back_inserter (splitResults));
ありがとう