|
Boost : |
From: chengst87 (christian.engstrom_at_[hidden])
Date: 2001-12-21 10:49:42
--- In boost_at_y..., John Maddock <John_Maddock_at_c...> wrote:
> >
> > The following program:
> >
> > #include <boost/regex.hpp>
> > void main() {
> > boost::regex aa;
> > boost::regex bb(aa);
> > }
> >
> > throws the exception boost::bad_expression("Empty expression.")
>
> Yes, I know about that, and it's on my list to change.
>
Excellent, I am looking forward to it in due course.
A related but different question: oughtn't the empty string be
considered a valid regular expression in its own right, i.e.: is it
really necessary and/or desirable that the declaration
boost::regex cc("");
throws an exception, instead of creating a regex object that matches
the empty string (and nothing else)? Such a regex object would
admittedly be rather pointless together with the regex_search
function, but it makes perfect sense when used with regex_match.
The reason I am asking is not entirely philisophical, because I would
actually need this functionality in code that I am writing right now,
but if there are reasons against changing the general regex package I
can of course easily make a workaround in my own code.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk