Boost logo

Boost Users :

From: Jeffrey Holle (jeff.holle_at_[hidden])
Date: 2004-11-06 11:13:05


Of "course".
That is what the optional operator is for.
Something like:
   *alpha_p << !(ch_p('-') << *digit_p)

Cory Nelson wrote:
> I'm trying to write a parser with elements that might not occur - is
> this possible?
>
> like:
>
> string ['-' number]
>
> that matches "foo" or "foo-123"
>


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