Re: [Boost-users] [string_algo] replace string with tokens

I'm not sure what you mean with 'replace command'. boost::algorithm::replace_all() simply replaces a substring with another.If you mean boost::algorithm::split() you can pass a predicate as the third parameter (boost::algorithm::is_punct() might help). Well I didnot find replace_all in usage of the bib. Now that you tell me, i can find it. But here I see no way to tell replace_all that my strings are not seperated by spaces but +*() etc. a+3*sin(b)
So what I had expected is like this: string str="a+3*sin(b)"; replace_all(str,"b", "Beta", "+*()") // now str="a+3*sin(Beta)"; Perhaps a task for tokenizer(?)
For what you are doing, perhaps regex_replace in Boost.Xpressive might be more useful? I'll have a look
Thanks Michael Schuster
participants (1)
-
Michael Schuster