|
Boost Users : |
From: Eric Niebler (eric_at_[hidden])
Date: 2004-05-03 15:15:40
John Maddock wrote:
>>i think, "(one|two|three|)" style alternation (notice the empty string on
>>the right) should be accepted and handled as "(one|two|three)?"
>>now it throws bad_expression
>
>
> I'm not sure about this one, Boost.regex has always deliberately rejected
> that, and although I realise that perl5 does accept this, perl6 will regard
> it as an error I believe.
>
Indeed, this will be an error in perl 6. See "Null String Reform" at
http://www.perl.com/pub/a/2002/06/04/apo5.html?page=10. You will have to
write this as (one|two|three|<null>).
I think it would be a horrible mistake for (one|two|three|) to be
handled as (one|two|three). Either accept it for what it is or reject
it, but don't try to second-guess what the programmer really meant.
-- Eric Niebler Boost Consulting www.boost-consulting.com
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