匹配整个句子
boost::regex e("\\d+");
bool res = boost::regex_match("1234", e);
从句子中搜索需要的内容
boost::regex e("(\\d+)\\D+(\\d+)");
boost::match_results<std::string::const_iterator> what;
std::string s("1234 1232 ab1 33a abc");
if (boost::regex_search(s, what, e, boost::match_default))
{
for (int i = 0; i < what.length(); i++)
{
std::string e = what[i];
}
}