$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
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