does boost's regex_replace not recognize named captures/groups or did I something wrong?
Yes it does, but remember that the C++ compiler gobbles up the \'s before regex gets to se those strings, so use \\ everywhere and you should be fine. HTH, John.
std::string date = "2012/01/30"; std::string replace = "\5\g{separator}\4\g{separator}\1\2"; // should be => 30/01/2012 boost::regex rx("^(19|20)(\d\d)(?<separator>[/.])(0[1-9]|1[012])\g{separator}(0[1-9]|[12][0-9]|3[01])$");
std::string replaced = boost::regex_replace(date, rx, replace);
The content in "replaced" is now "30\g{separator}01\g{separator}2012"
Thanks in advance
Best Regards NoRulez _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users