I'm surprised. The first backslash was already there to escape the
second. Are there maybe two steps of backslash interpretation at work,
one by the C++ compiler and one by Boost.Regex? In any case, I forgot
to escape the backslash in "\w", you'd probably have to give that one
the same treatment. And also the ones in "\&" and "\1" in the
replacement pattern.
But if you get the right result as the patterns stand right now,
that's of course also fine. :)