// replace #include <boost/tr1/regex.hpp> with
//         #include <regex>
// and
// std::tr1:: with std:: in the source code

#include <boost/tr1/regex.hpp>

#include <iostream>
#include <string>

int main(){

  std::cout << std::endl;
  
  std::string log="66.249.64.13 - - [18/Sep/2012:11:07:48 +1000] GET /robots.txt HTTP/1.0 200 468 - Googlebot/2.1\n"
                  "66.249.64.13 - - [18/Sep/2012:11:07:48 +1000] GET / HTTP/1.0 200 6433 - Googlebot/2.1";

  std::cout << log << "\n\n";

  // anonymize IPs
  std::tr1::regex rgxIPs(R"([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})");

  std::string anonymizeLog{std::tr1::regex_replace(log,rgxIPs,"XXX.XXX.XXX.XXX")};
  std::cout <<  anonymizeLog << std::endl;

  std::cout << std::endl;

}
