Boost logo

Boost :

From: Torsten Landschoff (torsten_at_[hidden])
Date: 2006-07-24 18:38:00


Hi Eric,

On Mon, Jul 24, 2006 at 03:29:40PM -0700, Eric Niebler wrote:
> Torsten Landschoff wrote:
> >
> > boost::smatch sm;
> > BOOST_REGEX_TEST(boost::regex_match(std::string(text), sm, re));
>
> Here is your problem. You're performing a match on a temporary
> std::string. After regex_match returns, sm will be left holding
> iterators into a destroyed string. Try:
 
Ouch, of course. Perhaps I should not be trying getting a grip at
boost::regex at this time. Thanks, I'll have to check if I produced the
same bug at work. I think I am not as the string is a member over there,
but I have to check.

Thanks again and good night,

        Torsten


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk