Boost logo

Boost Users :

From: Dilts, Daniel D. (ddilts_at_[hidden])
Date: 2008-03-24 16:58:20


I'm trying to tokenize lines of a file using the included static regex. I only care about the tokens indicated by s* = ... When I use the sregex_token_iterator to parse the lines, I only get the last match for s2 and s3.
 
How should I change things so that I can get every match for s2 and s3 rather than just the last match?
 
sregex whitespace_regex = *_s;
sregex line_regex =
    whitespace_regex >>
    (s1 = +_d) >> whitespace_regex >>
    (
        +(
            '\"' >> (s2 = *~as_xpr('\"')) >> '\"' >>
            whitespace_regex >> ':' >> whitespace_regex >>
            '\"' >> (s3 = *~as_xpr('\"')) >> '\"' >>
            whitespace_regex
        )
        |
        +(
            '\"' >> (s2 = *~as_xpr('\"')) >> '\"' >>
            whitespace_regex
        )
    );

This e-mail transmission contains information that is confidential and may be
privileged. It is intended only for the addressee(s) named above. If you receive
this e-mail in error, please do not read, copy or disseminate it in any manner.
If you are not the intended recipient, any disclosure, copying, distribution or
use of the contents of this information is prohibited. Please reply to the
message immediately by informing the sender that the message was misdirected.
After replying, please erase it from your computer system. Your assistance in
correcting this error is appreciated.


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