Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2007-03-15 09:20:34


Pavol Droba wrote:
> The only solution that I can comeup with is to run replace_all_regex
> twice. Once for #f pattern and the other time for the #g pattern.
>
> If you use format_literal, it is obvious, that (?1 and (?2 format
> specifiers are not evaluated.
>
> Maybe there is another solution for this, but I don't know about it.

Exactly, either the string contains format specifiers or it doesn't :-)

You would have to:

In each replacement string, escape all occurances of "[()$\\]" with \\$0,
then join the modified replacement strings together using (?1) etc to create
the format string.

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