Boost logo

Boost Users :

Subject: [Boost-users] [regex] expression: string iterator not dereferencable
From: Mitin Slava (mitinv_at_[hidden])
Date: 2011-10-07 08:41:20


Good day.

 

I use boost::regex with ICU. When I try call u32regex_match for symbol with
code 0xDA10, I get an expression "string iterator not dereferencable
(xstring, line 112)". If I use other symbol (for example, "X") it works
correctly. If I use wregex (wighout ICU) it works correctly too. What could
be the problem?

The code:

 

#include "stdafx.h"

#include <iostream>

#include <conio.h>

#include <boost/regex.hpp>

#include <boost/regex/icu.hpp>

 

int _tmain(int argc, _TCHAR* argv[])

{

    boost::u32regex delimiterRegex = boost::make_u32regex(L"\\W
<file:///\\W> ");

    std::wstring symbol = L"X";

    symbol[0] = wchar_t(0xDA10); // <= for this symbol

    if (boost::u32regex_match(symbol, delimiterRegex)) // <= assertion here

        std::cout << "success" << std::endl;

    else

        std::cout << "not match\n";

    _getch();

    return 0;

}

 

I checked it for boost_1_47_0.

MSVC 2008 compiler.

 

Thank you in advance,

Slava Mitin

 



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