Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2007-10-05 05:53:10


Mike Marchywka wrote:
> This hangs ( I thought it may be a repetition problem but reliably
> hits on this data/regex combo first pass):

Not for me: it works just fine here, my complete test program is below,
tested with cygwin g++ 3.4.4, and the version of Boost that's downloadable
with cygwin:

g++ -I /usr/include/boost-1_33_1 t.cpp -lboost_regex-gcc-mt

t.cpp:

#include <boost/regex.hpp>
#include <iostream>

int main()
{
   try{
      boost::regex e("ATG(...)*?(TAG|TAA|TGA)");
      const char* s =
"GAGATATTCACCTCTCATTGCCTTTTCCAGAGGTTGTTGAACTTAGTGGCCTGAGCATTTTA"
         "TCTGCAAAATGACTAGCAATTTTTTTTTAAGTTTCAGGCTTTTTTAATGCCCTAAATACAGTTGATCCATTACCGAGTGT"
         "GTTACATGCATAGGAATTTACTGATCTTTTCTTTTCCCCCTAGCTAGTTTTAAAGTTACTGAGCATAACGAGCTTTAAAA"
         "ATTCTTCAGAATACAAATAAATGAATAGATAAAAGACTACCTCCATTTGATAAATCATTCAAGAAAAAGAAAAAAAAACT"
         "TGAGCAAGCTAAGAAAGTCATTAACAGCCATATTTCTGATGGAACTAATGTxGATACCTACTCAAGCTAxCACTxGAATC"
         "TAATAATCTGTGAGAGAAGAAATGGGAAAAGGTATGAAAGC";

      boost::cregex_iterator a(s, s+strlen(s), e), b;
      while(a != b)
      {
         std::cout << *a << std::endl;
         ++a;
      }
   }
   catch(boost::regex_error e)
   {
      std::cout << e.what() << std::endl;
   }
   catch(std::exception e)
   {
      std::cout << e.what() << std::endl;
   }
}

So I still think that you have issues with your binary install, or build
method or something.

At this stage I'd recomend you rebuild the regex binaries using whatever
build options you are using: the exception problem is strongly indicating
that there is a binary incompatibity problem somewhere.

HTH, John.


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