Boost logo

Boost :

Subject: Re: [boost] [Tokenizer]Usage and documentation
From: Max (more4less_at_[hidden])
Date: 2011-02-10 02:32:09


Hello Stephen,

Thank you so much for your detailed information, which is exactly what I
need by now.

After a glimpse on your email address, It comes to me that you might be the
guy in a series of STL lectures I found on the net.
It's really you! Even though I'm not a very beginner of STL, I've watched
some of the video both for revisiting STL and for English practice. :-)

Thank you also for your STL lectures.

> > The part I could not interpret is:
> > ^|[\s,]
> > And
> > $|[\s,]
>
> The docs say:
>
> > A '^' character shall match the start of a line.
> > A '$' character shall match the end of a line.

Yes, I'm aware of this. But even with this in mind, I cannot interpret
"^|[\s,]" and "$|[\s,]".
For the former, I know '|' means alteration, but how can it be after '^'?
For the latter, how can "|[\s,]" be expected after the end of a line (and
the same confusion as above)?

>
> It depends on how strict you want to be (see the unusual examples below,
> especially involving empty fields). One approach is to describe the fields
you're
> interested in, and let regex_iterator find them. (Another approach,
activating
> regex_token_iterator's magical field splitting ability, doesn't seem to be
> applicable here because you want to handle quoted strings - if I'm wrong
> about that I'd love to find out). I suggest the following (I've used VC10
RTM
> std::regex here, but boost::regex will behave identically):
>
> C:\Temp>type meow.cpp
>
>[code snippet]
>
> C:\Temp>
>
> Stephan T. Lavavej
> Member of the Society for Regex Simplicity, I mean, Visual C++ Libraries
> Developer

One more question - with you code, any empty 'token' between two contiguous
',' is ignored, what if someday I'd like to pick them up?

B/Rgds
Max


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