Boost logo

Boost Users :

From: Mike Marchywka (marchywka_at_[hidden])
Date: 2007-10-04 17:21:43


OK, I think my earlier concern about greta dropping data was incorrect as it
was
the result of hastily adapting a piece of code for testing- that wouldn't
have
occured before. I went back to verify that boost still gives the same
results
as greta with simpler regexes and still have identical results.

Is there anything that "()" can do to the stack that could be causing flakey
results? This fails on some data ( program hangs or seg faults):
ATG(.)*?(TAG|TAA|TGA) >rule|2|DNA Euk ORF
This works on data I have ( although I thought I saw it failing earlier, I
have yet to see the 1000 other regex's fail in boost ):
ATG.*?(TAG|TAA|TGA) >rule|2|DNA Euk ORF

The working regex's do not have non-terminal "()"- while they may have
"()" these are only at begin or end and include two choices, one of which is
"^" or "|" )

My calling code looks something like this ( again, everything is char* )

while(regex_search(start, end, what, expression, flags))
   {
                   if (which>=what.size())
                   { es<<MM_MARK<<" which "<< which <<" vs size "<<what.size()<<'\n'; ;
return -1; }
                   int st=what[which].first - sample;
              int len=what[which].second-what[which].first;
              typedef VecTy::value_type Val;
              rv.push_back(Val(st,st+len ));
                   start = what[which].second;
                   // This makes things OVERLAP, may not be desired behavior.
                   if ( rv.olap_group()) start = what[0].first+1;
              if ( rv.olap_which()) start = what[which].first+1;
              // update flags:
              flags |= boost::match_prev_avail;
              flags |= boost::match_not_bob;

        }

Thanks again.

>From: "John Maddock" <john_at_[hidden]>
>Reply-To: boost-users_at_[hidden]
>To: <boost-users_at_[hidden]>
>Subject: Re: [Boost-users] follow up on regex questions
>Date: Thu, 4 Oct 2007 17:37:22 +0100
>
>Mike Marchywka wrote:
> > Hi,
> > Thanks for your help in the past. I would normally drop the issue at
> > this point
> > until I get my build environment cleaned up
> > (" My build is messed up, I haven't read the documentation. What is
> > wrong with YOUR library?" LOL).
> > but I do have one more question which I believe is related to boost
> > regex processing.
> > If someone has a known good regex test program or can point to an
> > obvious problem
> > it may be helpful.
>
>You mean libs/regex/test/regress/*.cpp ?
>
>It would be a good idea to build and run this to verify the sanity of your
>setup at least: I still have a suspision that the binaries you are using
>are
>not compatible with your build options or regex headers, but I can't be
>sure.
>
> > Again, this code seems to work with Microsoft's
> > greta and boost gives identical results on a longer list of SIMPLER
> > regexes so I reasonably believe that the problem is due to handling
> > of more complicated expression ( One caveat, to be complete, is that
> > greta did seem to return some spurious
> > results but they are easily filter programmatically, things like
> > negative location,
> > but the plausible ones that I have checked manually are right).
> > However, on this sequence of regexes (regexi?) I get either an abort
> > OR the program hangs
> > later on non-sensical execution (I know, "Gee, you have a build
> > problem and the stack is messed up?").
> >
> > myboost.cpp114 (GU.*?TACTAAC.{20,40}AG|^)(.*?)(GU.*?TACTAAC.{20,40}AG)
> > myboost.cpp114 ATG(...)*?(TAG|TAA|TGA)
> > myboost.cpp114 TATAA.*?ATAAA
> > myboost.cpp114 (GU.*?TACTAAC.{20,40}AG|^)(.*?)(GU.*?TACTAAC.{20,40}AG)
> > myboost.cpp114 ATG(...)*?(TAG|TAA|TGA)
> >
> > ( progam hangs in my code or had been core dumping in boost::regex )
>
>What is the text you are matching against? If you can give me a concrete
>example I can test it here, but "it hangs" isn't very useful I'm afraid ;-)
>
>John.
>
>_______________________________________________
>Boost-users mailing list
>Boost-users_at_[hidden]
>http://lists.boost.org/mailman/listinfo.cgi/boost-users

_________________________________________________________________
Help yourself to FREE treats served up daily at the Messenger Café. Stop by
today!
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGHM_OctHMtagline


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