-1
我想从字符串中提取数字:从串c提取号码++正则表达式
string line = "00:00:15,000 --> 00:00:18,000";
smatch results;
bool found = regex_match(line, results, regex("(\\d\\d):(\\d\\d):(\\d\\d),(\\d\\d\\d) --> (\\d\\d):(\\d\\d):(\\d\\d),(\\d\\d\\d)"));
/*for (auto result : results) {
cout << result << endl;
}*/
int res = atoi(*results[3]);
我可以轻松打印结果(注释代码),但我不能隐蔽结果为int。对于这个结果数组,由于某种原因解引用不起作用。