Error with boost::regex library with Borland C++ Builder 6
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
I haven't had the time to look in detail at your code, but have you turned on codeguard support - it should give you an idea of what is happening - if necessary add the regex source to your project so that it gets built with codeguard support as well. John Maddock http://ourworld.compuserve.com/homepages/john_maddock/index.htm ----- Original Message ----- From: "ynaig2k" <giany2k@hotmail.com> To: <Boost-Users@yahoogroups.com> Sent: Thursday, March 14, 2002 3:45 AM Subject: [Boost-Users] Error with boost::regex library with Borland C++ Builder 6
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
Info: <http://www.boost.org> Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl> Unsubscribe: <mailto:boost-users-unsubscribe@yahoogroups.com>
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
participants (2)
-
John Maddock
-
ynaig2k