Boost logo

Boost Users :

Subject: Re: [Boost-users] regex icase
From: Micha³ Nowotka (mmmnow_at_[hidden])
Date: 2009-08-26 06:40:53


Ok, so this is simple example - stupid but should work:

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

class Mask : public boost::regex
{
   public:
      Mask(const std::string& str)
      :boost::regex()
      {
       assign(str,boost::regex::optimize);
      }

      Mask(const Mask& other)
      :boost::regex(other.str(), other.flags())
      {}

      void setIgnoreCase(bool ignoreCase = true)
      {
        assign(str(), ~boost::regbase::icase);
      }
};

int main(int argc, char **argv)
{
 Mask mask("foo");
 mask.setIgnoreCase();
}

then:

$ g++ example.cpp -lboost_regex-mt
$ ./a.out
Segmentation fault

-- 
Regards
Micha³ Nowotka

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