I use pcrecpp c++ ( PCRE lib )
And i need get all matches in cycle. How can i do it?
For example pattern:
"hello"
and subject:
"hello hello hello"
Cycle should loop 3 times ( because 3 matches )
1 hello
2 hello
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 () );
}
Please give me some example code how to do it with pcrecpp.h.
Sorry for my bad english.