Boost logo

Boost Users :

From: John Maddock (john_maddock_at_[hidden])
Date: 2002-08-17 05:21:45


> Drat. I thought that might be it after reading the docs, but I
> figured that the expression "? would also match leftmost longest (that
> is, a single " is better than the null string). Also, I thought that
> by putting a non-capturing group (?:"?) around the expression, this
> would leftmost-longest match the ". And yet it didn't.

Leftmost longest applies only to marked sub-expressions - there is no
concept of greedy or non-greedy repeats as such in the POSIX standard.
(?:\"?) isn't a marked subexpression BTW :-)

>
> (I also tried "* and "{0,1} etc.)
>
> Sigh. I *really* did read the docs before emailing. :)
>
> > A simpler solution to your problem is to use a + quantifier rather
> > than a *, so that it can't match the null string:
>
> Unfortunately, the match can be empty, hence we couldn't use +.
>
> But thanks for the reply, and for the library!
>
>
>
> Info: <http://www.boost.org>
> Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl>
> Unsubscribe: <mailto:boost-users-unsubscribe_at_[hidden]>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


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