gpt4 book ai didi

C++ 将 Boost Regex 匹配结果转换为其他格式

转载 作者:塔克拉玛干 更新时间:2023-11-03 06:53:59 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
How to convert a number to string and vice versa in C++

我应该如何将 boost::regex 匹配结果转换为其他格式,例如带有以下代码的整数?

string s = "abc123";
boost::regex expr("(\\s+)(\\d+)");
boost::smatch match;
if(boost::regex_search(s, match, expr)) {
string text(match[0]);
// code to convert match[1] to integer
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com