Boost logo

Boost Users :

From: ynaig2k (giany2k_at_[hidden])
Date: 2002-03-13 22:45:49


Hi,

I tried everything to understand why I get the error "Abnormal
program termination" in the second run of the function with the
following code:

void function()
{
regex e( std::string(Edit1->Text.c_str()) );
cmatch what;
string response;
TFileStream* file = new TFileStream( "1.htm", fmOpenRead );

response.resize(file->Size+1);
file->Read(response.begin(), file->Size);

response[file->Size] = 0;

delete file;

std::string::const_iterator start;

start = response.begin();

while( regex_search( start, what, e ) )
{
   for ( unsigned int i = 0 ; i < what.size() ; i++ )
   { {
      std::string result = std::string(what[i].first, what[i].second);
      Memo1->Lines->Add( result.c_str() );
   }
   Memo1->Lines->Add("");
   start = what[0].second;
}
}

Thanks


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net