
26 Aug
2009
26 Aug
'09
10:40 a.m.
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