string strStl="select aaaaa from bbbbb";
boost::regex expression("^select ([a-zA-Z]*) from ([a-zA-Z]*)");//如果是这句就有匹配内容
boost::regex expression("select ([a-zA-Z]*) from ([a-zA-Z]*)");//如果是这句就有匹配内容
boost::regex expression("([a-zA-Z]*) from ([a-zA-Z]*)");//如果是这句就没有匹配内容 boost::cmatch what; if(boost::regex_match(strStl,what,expression))
{
AfxMessageBox("有");
}
else
{
AfxMessageBox("没有");
}我的感觉是那三句都应该有匹配内容的。
1,2句,匹配整句。
3匹配aaaaa from bbbbb为什么3却没匹配到呢?