2011/3/18 Julian Gonggrijp <j.gonggrijp@gmail.com>
Olivier Tournaire wrote:

2011/3/17 Julian Gonggrijp <j.gonggrijp@gmail.com>

Search pattern: "\\u(\w{4})"

It seems that we also have to escape the "\" in "\u". The working regex seems to be:

"\\\\u(\w{4})"

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?

I forgive to say that I finally used Qt (since I already used it in my project) which has a convenient QString::replace method which handles 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.

Yes, you are right, I should have also mentionned them.
 

But if you get the right result as the patterns stand right now,
that's of course also fine. :)

Thank you for pointing me in the right direction!

Regards,

Olivier
 

-Julian

_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users