regex_replace -- format_default

Hi I am trying to use boost::regex_replace but I am having trouble understanding the format to use for the the format string. The Ecma-262.pdf rules for how to create a format string seem quite terse. Does anyone know of a reference that has some more examples? Here is the code I am trying to write: #include <boost/regex.hpp> #include <string> #include <iostream> int main(int argc, char** argv) { std::string str; boost::regex expression("abc"); std::string fmt(""); // WHAT GOES HERE? fn = "abcabcabc"; boost::regex_replace(str, expression, fmt); std::cout << str << std::endl; return 0; } Thank you, Ivan Novick http://www.0x4849.net

ivan@0x4849.net wrote:
Hi
I am trying to use boost::regex_replace but I am having trouble understanding the format to use for the the format string.
The Ecma-262.pdf rules for how to create a format string seem quite terse. Does anyone know of a reference that has some more examples?
Try http://www.boost.org/libs/regex/doc/format_perl_syntax.html the ECMA and Perl Syntaxes are the same. I'll update the docs to make that clearer. HTH, John.
participants (2)
-
ivan@0x4849.net
-
John Maddock