title: How do I insert format str and don't remove the matched regular expression in input string in boost::regex_replace() in C++?
body: <p>I want to put space between punctuations and other words in a sentence. But boost::regex_replace() replaces the punctuation with space, and I want to keep a punctuation in the sentence!
  for example in this code the output should be "Hello . hi , " </p>
  
  <pre><code>regex e1("[.,]");
  std::basic_string&lt;char&gt; str = "Hello.hi,";
  std::basic_string&lt;char&gt; fmt = " ";
  cout&lt;&lt;regex_replace(str, e1, fmt)&lt;&lt;endl;
  </code></pre>
  
  <p>Can you help me?</p>