Boost logo

Boost Users :

From: Winson Yung (winson.yung_at_[hidden])
Date: 2006-08-05 03:03:33


I have a very simple test program using the latest 1.33 version of regex
library. As soon as I run it, it assert (crash) at the line where
std::string s = (*m1)[0]. I am doing something wrong?

==============
#include "stdafx.h"
#include <boost/regex.hpp>

const char matchpattern[] = "\\s+kitty this";
const char astring[] = "hello Kitty this is a test";

using namespace boost;

int main(int argc, char* argv[])
{
    regex header_expr(matchpattern, regex_constants::basic |
regex_constants::icase);

    cregex_iterator m1(astring, astring + strlen(astring), header_expr);

    std::string s = (*m1)[0]; <==== crash here
    return 0;
}



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