Boost logo

Boost :

From: Jan Hermelink (Jan.Hermelink_at_[hidden])
Date: 2005-07-13 12:00:12


> It looks more like a bug than by design if you ask me.
I don't think so - this behaviour is specified in the standardization
proposal.
To quote from
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1429.htm,
Chapter "RE.8.2 Template class regex_token_iterator":

"If the end of sequence is reached (regex_search returns false), the
iterator becomes equal to the end-of-sequence iterator value, unless the
sub-expression being enumerated has index -1: In which case the iterator
enumerates one last string that contains all the characters from the end
of the last regular expression match to the end of the input sequence
being enumerated, provided that this would not be an empty string."

!!! "provided that this would not be an empty string" !!!

> I don't agree.
> I think this is counterintuitive, both for string_algo and regex
May be, but the above described behaviour has a good change to be
standardized,
and boost::split() should do the same thing.

Jan

-----Original Message-----
From: boost-bounces_at_[hidden]
[mailto:boost-bounces_at_[hidden]] On Behalf Of Thore Karlsen
Posted At: Wednesday, July 13, 2005 6:03 PM
Posted To: Boost Developer
Conversation: [boost] [regex and string algo] again strange split
behaviour
Subject: Re: [boost] [regex and string algo] again strange split
behaviour

On Wed, 13 Jul 2005 16:42:06 +0200, "Jan Hermelink"
<Jan.Hermelink_at_[hidden]> wrote:

>The 1.32 behaviour is compatible with Boost.Regex:
>
>boost::regex_token_iterator in splitting mode returns for
>
>"abc/abc/" -> 2 tokens
>
>This is compatible with the regex standardization proposal.
>
>I think the behaviour of boost::split should be the same.

I don't agree. I think this is counterintuitive, both for string_algo
and regex. It looks more like a bug than by design if you ask me.

-- 
Be seeing you.
_______________________________________________
Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost

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