Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > app crash on simple boost::regex

Reply
Thread Tools

app crash on simple boost::regex

 
 
expert.cpp@gmail.com
Guest
Posts: n/a
 
      08-14-2008
Hi, I'm trying to use this regex code:

const boost::regex::flag_type f = boost::regex_constants::normal |
boost::regbase::icase;
const boost::regex fooo(
".*"
"unit"
"[ \t]+"
"[A-Z]|[a-z](?:[A-Z]|[a-z]|[0-9]|_)*"
"[ \t\n]+?"
"\{"
"[ \t\n]+"
"(.*)"
"\}"
"([^}]*)"
, f);

const std::string sTemp(szFileBuf); // исходный текст в szFileBuf
boost::match_results<std::string::const_iterator> what;
bool bRet = boost::regex_match(sTemp, what, fooo);


to get the body of block "unit" (just a list of function definitions)
and the last part: a call to one of those functions, In this case it
is MainFunction(), from this file


// comments
unit XXX
{
//
#include "header.h"

// arbitrary number of C/C++ functions
a_type Function1([optional args])
{
// C/C++ code
}

a_type FunctionN([optional args])
{
// C/C++ code
}

type MainFunction([optional args])
{
// C/C++ code
}
}

MainFunction();


It works with first 4 parts of regular expression. But it crashes when
I add other parts.
Can somebody help me correct this regex?

I'm doint that on Vista 64-bit, with Visual Studio 2005, boost::regex
linked statically if that matters.

Thanks,
Sava



 
Reply With Quote
 
 
 
 
brad
Guest
Posts: n/a
 
      08-15-2008
Try the boost mailing list. They may help you.

http://www.boost.org/community/groups.html#users
 
Reply With Quote
 
 
 
 
mlimber
Guest
Posts: n/a
 
      08-15-2008
On Aug 15, 9:11*am, brad <(E-Mail Removed)> wrote:
> Try the boost mailing list. They may help you.


No, this is a legitimate question here since Boost.Regex became TR1's
Regex.

Cheers! --M
 
Reply With Quote
 
peter koch
Guest
Posts: n/a
 
      08-15-2008
On 15 Aug., 17:37, mlimber <(E-Mail Removed)> wrote:
> On Aug 15, 9:11*am, brad <(E-Mail Removed)> wrote:
>
> > Try the boost mailing list. They may help you.

>
> No, this is a legitimate question here since Boost.Regex became TR1's
> Regex.


Well... that does not invalidate Brads very good suggestion!

/Peter
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
app crash when there's more than 3000 entries in std::map ? mast4as C++ 4 08-12-2010 06:03 PM
my ISP said that my asp.net 2.0 app causes their application pool to crash Nalaka ASP .Net 3 02-08-2007 03:58 AM
Crash in CreateJavaVM after loding libjvm.so(jre1.4) from C app dynamically... kiran.dpatil@gmail.com Java 0 04-22-2005 09:38 AM
what in this value is making an app.config crash an app? Chris Kimmel ASP .Net Security 2 06-16-2004 01:54 PM
CRASH - DirectX End-User runtime - CRASH - What to to ? reply@newsgroup.please Computer Support 1 01-05-2004 02:55 PM



Advertisments