Boost logo

Boost Users :

Subject: Re: [Boost-users] Can Regex callback function arguments be modified?
From: Ramon F Herrera (ramon_at_[hidden])
Date: 2009-09-19 14:00:15


Hi John,

Thanks for your kind reply.

My code is based on this program of yours:

http://patriot.net/~ramon/regex_iterator_example.cpp.txt

My data is structured like this:

[Unique ID1]
Variable Name = Variable Value
Variable Name = Variable Value
Variable Name = Variable Value

[Unique ID2]
Variable Name = Variable Value
Variable Name = Variable Value
Variable Name = Variable Value
Variable Name = Variable Value

All I need to do is to extract the different parts, to be saved in a
map. In my first callback, I divide every section into (a) Unique ID,
and (b) rest of the (multiline) block. Once I have the latter, I make a
call to a second callback to break the LHS and the RHS of each
assignment expression.

So you say that the callback is really not required?

Thanks!

-Ramon

John Maddock wrote:
>> I am having some trouble with the Regex callback architecture. Fist of
>> all for, for a variable number of matches, the only way to code is with
>> a callback function and for_each iterator, correct?
>
> What callback architecture? Regex is iterator based: see regex_iterator
> and regex_token_iterator. Of course you could pass these iterators to
> std::for_each along with a callback function, but there's really no need
> to do that. What is it you're trying to do?
>
> John.


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