1
我使用pcrecpp C++(PCRE lib)
而且我需要獲取週期中的所有匹配。我該怎麼做?Pcrecpp匹配
例如圖案:
「你好」
和主題:
「你好你好你好」
週期應循環3次(因爲3個匹配)
1喂
2喂
3 hello
Pseudocode
pcrecpp::RE pPattern ("hello");
std::string strBase = "hello hello hello";
// ...
int iMatches = // Match count
for (int i = 1; i < iMatches; i++)
{
printf("%d %s", i, pPattern[ i ].c_str());
}
請給我一些示例代碼如何用pcrecpp.h做到這一點。
對不起,我英語不好。