Hi all
Can you please help me with this issue ?
I am trying to create - pcrecpp objects and get them into a vector in order to check them later with an iterator :
ifstream Input;
string Line;
string URL;
typedef vector<const pcrecpp::RE*> URL_list;
URL_list m_URL_list;
while(Input) {
getline(Input,L ine);
m_URL_list.push _back(( new pcrecpp::RE(Lin e) ) ) ;
}
// trying to run with an iterator on all the lines
// and see if I get matches
//the objects in the file was
// .*cnn.com , .*cnn.com.* , cnn.com*.
//but none of the was found equal to the list below
// can you please tell me if I built the objects and the iterator ok ?
// when I am doing (pcrecpp::RE(". *cnn.com").Full Match... it finds the matches
URL_list::itera tor it = m_URL_list.begi n(),
ite = m_URL_list.end( );
for(; it != ite; ++it) //PartialMatch looks for the word any where
{
if((*it)->FullMatch("cnn .com"))
printf("###MATC HES cnn.com \n" );
if((*it)->FullMatch("ima ges.cnn.com"))
printf("###MATC HES images.cnn.com \n" );}
if((*it)->FullMatch("cnn .com/images"))
printf("###MATC HES cnn.com/imagesON1 \n" );
if((*it)->FullMatch("bc. cnn.com/images"))
printf("###MATC HES bc.cnn.com/images ON1 \n" );
}
//Thanks for your help
Can you please help me with this issue ?
I am trying to create - pcrecpp objects and get them into a vector in order to check them later with an iterator :
ifstream Input;
string Line;
string URL;
typedef vector<const pcrecpp::RE*> URL_list;
URL_list m_URL_list;
while(Input) {
getline(Input,L ine);
m_URL_list.push _back(( new pcrecpp::RE(Lin e) ) ) ;
}
// trying to run with an iterator on all the lines
// and see if I get matches
//the objects in the file was
// .*cnn.com , .*cnn.com.* , cnn.com*.
//but none of the was found equal to the list below
// can you please tell me if I built the objects and the iterator ok ?
// when I am doing (pcrecpp::RE(". *cnn.com").Full Match... it finds the matches
URL_list::itera tor it = m_URL_list.begi n(),
ite = m_URL_list.end( );
for(; it != ite; ++it) //PartialMatch looks for the word any where
{
if((*it)->FullMatch("cnn .com"))
printf("###MATC HES cnn.com \n" );
if((*it)->FullMatch("ima ges.cnn.com"))
printf("###MATC HES images.cnn.com \n" );}
if((*it)->FullMatch("cnn .com/images"))
printf("###MATC HES cnn.com/imagesON1 \n" );
if((*it)->FullMatch("bc. cnn.com/images"))
printf("###MATC HES bc.cnn.com/images ON1 \n" );
}
//Thanks for your help
Comment