私はpcrecpp c ++(PCRE lib)を使用
し、すべての一致をサイクルで取得する必要があります。どうすればできますか?
例:
「こんにちは」
件名:
「こんにちは、こんにちは」
サイクルは 3 回ループする必要があります (3 つの一致があるため)
1 ハロー
2 ハロー
3 ハロー
疑似コード
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 でそれを行う方法のサンプル コードを教えてください。
私の悪い英語でごめんなさい。