#include #include #include using namespace std; int main() { string s = "Hello, world!"; boost::regex expr("(\\w+),\\s(\\w+)!"); string fmt("\\1, Boost.Regex!"); cout << boost::regex_replace(s, expr, fmt) << endl; return 0; }