重複の可能性:
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
}