0
如何在使用std::tr1::regex_search
時獲得匹配的索引?從tr1獲取匹配的索引:: regex_search
// sequence of string sub-matches
std::tr1::smatch result;
if (!std::tr1::regex_search(text, result, pattern))
return false;
我只能得到來自std::tr1::smatch result
變量的字符串,而不是匹配的索引。
好吧,那根本沒有升級。 – 2013-03-18 16:48:40
我發現該方法感謝這個答案 - http://stackoverflow.com/a/234277/492336。這是關於Boost,但是正則表達式在tr1中似乎是相同的。所以StackOverflow仍然有很多幫助。 – sashoalm 2013-03-18 16:51:31