我boost::regex
用来匹配(最好说boost::regex_search
)文本与正则表达式。
这个不匹配,我的正则表达式真的很大。
你知道图书馆里是否有任何函数告诉我正则表达式的哪一部分不匹配?
我正在使用 LINUX/gcc
std::string text; // whatever
boost::regex rgx( "(\\w+) (\\d+) (\\s+)" );
boost::smatch m;
if( !boost::regex_search( text, m, rgx ) ){
// how to know where (\\w+) or (\\d+) or (\\s+) failed?
}