【发布时间】:2015-07-09 09:59:03
【问题描述】:
我有以下行 /90pv-RKSJ-UCS2C usecmap
std::string const line = "/90pv-RKSJ-UCS2C usecmap";
auto first = line.begin(), last = line.end();
std::string label, token;
bool ok = qi::phrase_parse(
first, last,
qi::lexeme [ "/" >> +~qi::char_(" ") ] >> ' ' >> qi::lexeme[+~qi::char_(' ')] , qi::space, label, token);
if (ok)
std::cout << "Parse success: label='" << label << "', token='" << token << "'\n";
else
std::cout << "Parse failed\n";
if (first!=last)
std::cout << "Remaining unparsed input: '" << std::string(first, last) << "'\n";
我想在标签中90pv-RKSJ-UCS2C和在令牌变量中usecmap。
我提取了 90pv-RKSJ-UCS2C 值,但没有提取 usecmap
【问题讨论】:
标签: c++ boost boost-spirit boost-spirit-qi