Boost logo

Boost :

From: Dave Jenkins (david_at_[hidden])
Date: 2007-11-23 23:51:08


"Dave Jenkins" <david_at_[hidden]> wrote in message
news:fi7d0e$60a$1_at_ger.gmane.org...
>
> Oh, I see. How about something like this? It allows you to selectively
> skip spaces for parts of your regex.

I was thinking about the "selective filter iterator" example that I posted
and realized that it won't handle xpressive backtracking properly. You can
see it malfunction if you change the regex to:

    regex_skip rx =
        normal >> as_xpr("a a") >>
        skip_spaces >> as_xpr("bb") >>
        *as_xpr('c') >> // This causes the regex to fail when it should
succeed
        normal >> "c c";

The "selective filter iterator" idea is right, it's just the iterator needs
to remember when to skip spaces as it backtracks. I'll post another
(hopefully correct) example when I've thought about it a bit.


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